DEV Community

Cover image for Adding Ruby to System Environment
Anna Villarreal
Anna Villarreal

Posted on

1

Adding Ruby to System Environment

I have been learning Ruby recently in an online environment. But I wanted to try to create and run an app from my local computer, using Ruby. I recently created a simple webpage for fun. I wanted to convert it to Ruby to really solidify those skills.

I had previously never messed with environment/system variables. This morning turned out to be a little more lengthy than anticipated. After cloning the project from github and putting it on my local editor, I created a gemfile and tried to "bundle install". I was wondering why it wasn't working. I kept getting messages in the terminal:

error message

For some reason, I thought I had ruby installed on my local machine.

anime girl thinking

Turns out, I did not. Here is the can of worms. After 20 minutes of googling and this discovery, I install Ruby locally. Great. Ruby should work now, right?


Not quite. You didn't think it was that easy, right? I did! Turns out, I needed to do a few more steps. I'm going to give you the simplified version of my experience this morning. XD


After Installing Ruby

You may need to add a system environment variable manually as I did. Alright then. More uncharted territory! I learn that we can do so by accessing "Edit the system environment variables".

environment variables

We then navigate to "Path" in System Variables:

system variables

With "Path" selected we click edit and then select "New"

new variable

Then we type in the executable path:
type in path


Finding your executable path

What is an executable path, and how do we find it? In order for Ruby to work in your program, you need to tell the system where to find this information. Open up your system terminal and type in "gem environment". This will give you the pertinent info.


executable directory

Look for the little charmer called "EXECUTABLE DIRECTORY". This is the path you need in your new system variable. Mind your slashes, the system will not accept a copy-and-paste. Enter that as so:

variable added

Save everything and close. Restart your editor.



Now check that everything is properly setup:
check install

Run "bundle install" in your editor terminal, given that you already have created a gemfile and such.

bundle install

Magic! XD


walking towards light
I'm sure there is a fancy way to do this all in the terminal, alas, I am a beginner. Onward and upward!!

Image of Docusign

πŸ› οΈ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (4)

Collapse
 
free_programmers profile image
Free Programmers β€’

This article is simple but very practical.
β€οΈπŸ‘

Collapse
 
annavi11arrea1 profile image
Anna Villarreal β€’

Hey thank you ^.^ i appreciate that.

Collapse
 
free_programmers profile image
Free Programmers β€’

The quality of an article depends on its author! /.:.\

Thread Thread
 
annavi11arrea1 profile image
Anna Villarreal β€’

Facts for sure!

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

πŸ‘₯ Ideal for solo developers, teams, and cross-company projects

Learn more

πŸ‘‹ Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay