Where is my ruby gems path set?

software development

#1

As Dreamhost has not been keeping up to date with their Ruby installation the support has suggested that I just compile it myself in my user directory and run it from there.

A fine suggestion so I have been attempting to do just that using the documentation here as a guide only:

http://wiki.dreamhost.com/Ruby_on_Rails_Installation

The last time this guide seems to have been updated is 2009.

It’s going pretty well except I am anticipating problems down the road because I noticed a number of the compiles were looking here:

/usr/lib/ruby/gems/1.8/gems/

this was causing some errors but for some reason no fails…

but obviously what I would rather would be if everything I run were to be looking here for everything gem related:

/home/tribey/local/lib/ruby/gems/2.1.0

examining my PATH i see that it’s pointing up to the old place…

[dwalin]$ $PATH
-bash: /home/tribey/local/bin:/home/tribey/usr/bin/:/home/tribey/usr/share/:/home/tribey/.gems/bin:/usr/lib/ruby/gems/1.8/bin/:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games: No such file or directory

(don’t know why /usr/games is in there either)

I don’t know if this is why the compile of rubygems was looking there…

looking at my .bash_profile and .bashrc does not provide any answers.

Can anyone tell me where these paths are being set so I can change them?

If anyone can offer any other suggestions or advice please feel free.

thank you!

this is the website that I am setting this up under which at the moment is dumping alot of information about the environment…

http://www.devweb.org/


#2

I was also having the same problem, but for different reasons.

I was using rvm to install ruby and rubygems. and there were many path issues.

using: rvm doctor
it told me to unset GEM_HOME and RUBYLIB.
once I did this, rvm no longer looked at the default install.

hope this helps some.

I am using information at:
RVM
RubyGems


#3

Perhaps I’m missing something but where do you unset those?

How do you ensure they are not going to be set again?


#4

Sorry for the delayed response, I have been far away from a computer for some much needed time in the woods.

To answer the last question, I don’t know what keeps the variables from being reset.
However, before you unset them, make sure you don’t have other users/projects dependent on finding the ruby path.
Because, I would assume unless your using somethin like RVM to manage your ruby instances/versions, that removing the system variable will cause issues with other ruby projects on your server.

How I unset them:
I ssh’d into my VPS,
cd’d into my ruby project and I get the following:

cd /home/domain/projects/rubyproject RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too, you can ignore these warnings with 'rvm rvmrc warning ignore /home/domain/projects/rubyproject/Gemfile'. To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.

I think this is because it is RVM managed, but I don’t know.
then I just typed:

Then you can set to your custom path:

I am not sure you will need to update your $PATH var.
You may just be able to set RUBYLIB in a similar fashion.

If you are using RVM:

rvm doctor rvm requirements
are both useful

This returns a list of items, that can be tuned, configured, or ignored.
However, in this case, I no longer get errors about incorrect ruby version and gems not being found.

regards