Topic: Getting RVM / rails working on ubuntu issue

Hey! So I've decided to switch to ubuntu and save myself a lot of hassle in the future.  I'm still having some trouble though getting my installations of rails/ruby up and running correctly.

For some reason, when I open the terminal after a fresh bootup, and do 'ruby -v', it says ruby 1.8.7.  When I cd to LaunchUS (my project folder) and try to 'rails s', it says I need to bundle, which I had done before.   But then if I do 'source ~/.bash_profile' and then try doing 'rvm use 1.9.2 --default' it lets me do it, and then 'ruby -v' shows 1.9.2.  I can then 'cd LaunchUS' and bundling works appropriately.    Is there something I'm missing here? What's with the need to do source ~/.bash_profile ?

A log of the issue can be found here: http://pastebin.com/nVkGXLad

Last edited by icydash (2012-03-29 17:19:18)

Re: Getting RVM / rails working on ubuntu issue

Was this right after you made a change to your bash_profile?

The rest of the errors are there because you don't have a javascript gem installed. I've been using therubyracer. If you have the default gemfile, you can probably find it listed in there, you just need to remove the # before gem 'therubyracer'.

Re: Getting RVM / rails working on ubuntu issue

Sorry, I have updated the pastebin. I was able to fix all the javascript / 'rails s' issues. 

My main problem is having to do source ~/.bash_profile every time I open my terminal to get stuff working.

As you can see, when I initially log in, and do 'ruby -v' it says Ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

And when I do 'rvm use 1.9.2 --default' I get:

RVM is not a function, selecting rubies with 'rvm use ...' will not work.
Please visit https://rvm.beginrescueend.com/integrat … -terminal/ for a solution.






It doesn't work correctly until I do ~/.bash_profile and then it all works right:

zsk@ubuntu:~$ rvm use 1.9.2 --default
Using /home/zsk/.rvm/gems/ruby-1.9.2-p318

Last edited by icydash (2012-03-29 17:22:01)

Re: Getting RVM / rails working on ubuntu issue

Do you have a ~/.bash_login file? If so, add the following to it, if not then create it and add the following to it:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

Hope that does the trick for you.

Re: Getting RVM / rails working on ubuntu issue

Got it working.  Actually had to copy the .bash_profile to bashrc.

In case anyone else has this problem, the command was:    cp ~/.bash_profile ~/.bashrc

Re: Getting RVM / rails working on ubuntu issue

I also use this cp ~/.bash_profile ~/.bashrc
so now it working