2

I had used below mentioned commands to install rails in ubuntu 12.10

sudo apt-get update

sudo apt-get install curl

\curl -L https://get.rvm.io | bash -s stable

source ~/.rvm/scripts/rvm

rvm requirements

rvm install 1.9.3

rvm use 1.9.3 --default

rvm rubygems current

gem install rails

Every steps are doing good, but it works for terminal which we are installing rails. If we exit from the terminal and work on a new terminal then the following error occurs.

The program 'rails' can be found in the following packages: * rails * ruby-railties-3.2 Try: sudo apt-get install

Help me to install rails.

4 Answers 4

2

You have to load the rvm script into your shell.

Put this at the end of your .zshrc or .bashrc or whatever depending on your shell :

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" 
2
  • I can't make use of this command, if u can plz instruct step by step process how to put this code at the end of .bashrc file. Feb 16, 2013 at 6:17
  • open it with a text editor, for instance, gedit : gedit ~/.bashrc
    – Intrepidd
    Feb 16, 2013 at 10:43
0

Not really sure what exactly your problem is. If you use rvm and have installed Rails with it, you may have to use

rvm use 1.9.3 after gem install rails.

Then you may or may have not a gemset with this. So:

bundle install

should install Rails gem in this gemset. Maybe use

rvm sudo bundle install

or just manually install the Rails gem.

0

source ~/.rvm/scripts/rvm rvm --default use 1.9.3-p374

By running the following code at each terminal Ruby on rails get starts to work.
This problem is occurred because

1
  • sorry for such a delay reply, plz tell me the reason why this happens Jun 25, 2013 at 13:56
0

open the terminal preferences and make sure the "run command as a login shell" option is checked in the "title and command" tab, it will load the ~/.bash_profile which contains something like "[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" and set the rvm env for you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .