2

I recently reinstalled Ubuntu 12.04 after the upgrade package broke my last install. I've been following this walkthrough to restore Rails and continue working on my existing projects. I've already installed rvm, all the packages listed by rvm requirements, and all my development tools (e.g., vim, git, etc.).

However, I get stuck on the rails command, whether I'm trying rails (n,s,g), and returns the error message

$ rails
The program 'rails' is currently not installed.  You can install it by typing:
sudo apt-get install rails

I've already done the following:

$ gem install rails
Successfully installed rails-3.2.3
1 gem installed

But based on the following checks, it still hasn't installed.

$ which gem
/home/eyoung/.rvm/bin/gem
$ which ruby
/home/eyoung/.rvm/bin/ruby
$ which rails
(no output)

I'm at my wit's end; any ideas on what's going on?

Extra details:
OS: Ubuntu 12.04 x86_64
Packages: RVM installed Ruby 1.9.3p194 w/ openssl & Rubygems
ruby and gem are on the system $PATH

EDIT: By request,

$ gem list rails
*** LOCAL GEMS ***
rails (3.2.3)
Edwin
  • 2,074
  • 1
  • 21
  • 40
  • `gem list rails` prints what? Most likely you don't have `rails` in your path. – wkl Apr 28 '12 at 21:53
  • @birryree Based on output, it *is* there, but how is it not on my path? I thought it's part of the `~/.rvm` directory when installed through `rvm`. Besides, what directory would I have to add to my `~/.bashrc`? – Edwin Apr 28 '12 at 22:04
  • You need to set your `rvm` to use a specific ruby as the default: `rvm use 1.9.3 --default`. This will set all the paths correct. – wkl Apr 28 '12 at 22:08
  • @birryree Thanks, that solved the problem. Must not show up in the default search settings because it's probably viewed as trivial. If you want, leave it as an answer, and I'll accept it. – Edwin Apr 28 '12 at 22:14

2 Answers2

2

As rails gem was installed and all the other paths look correct, you need to set rvm to use that ruby as your default version. It will set all the paths correctly so you can use your gems and rails command.

rvm use 1.9.3 --default
wkl
  • 77,184
  • 16
  • 165
  • 176
0

I updated to 12.04 as well, and ran into the issue as well. After quite a bit of head scratching, I decided to reinstall rvm.

Referencing a previous question.

Community
  • 1
  • 1
duggiefresh
  • 283
  • 1
  • 8