`gem install` appears to succeed in installing rails, but `gem list` doesn’t see it

I'm unable to get Rails properly installed and working on my openSUSE Tumbleweed machine.

I'm broadly following the [RailsGirls instructions](http://guides.railsgirls.com/install#setup-for-linux) (modified accordingly since they don't have a specific script for openSUSE, only Ubuntu and Fedora).

First, I installed RVM and had it install and default to ruby 2.3.1.

Then I did `gem install bundler` which worked fine.

`gem install rails` failed during nokogiri compilation until [I had it use the system libraries](http://stackoverflow.com/a/27280099/2934226). But it seems like the things I install with `gem install` don't actually seem to be getting acknowledged as being installed:

$ NOKOGIRI_USE_SYSTEM_LIBRARIES=true gem install nokogiri
$ gem install rails
[works and installs rails and a bunch of other gems as dependencies]
$ which rails
/home//.gem/ruby/2.3.0/bin/rails
$ gem list | grep -i rails | wc -l
0
$ rails -v
/home//.rvm/rubies/ruby-2.3.1/lib64/ruby/site_ruby/2.3.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem railties (>= 0.a) (Gem::GemNotFoundException)
from /home//.rvm/rubies/ruby-2.3.1/lib64/ruby/site_ruby/2.3.0/rubygems.rb:298:in `activate_bin_path'
from /home//.gem/ruby/2.3.0/bin/rails:22:in `

'

What the heck is going on here?

1 thought on “`gem install` appears to succeed in installing rails, but `gem list` doesn’t see it”

  1. I’ve seen similar behavior from RVM when it isn’t installed properly. I’m not familiar with OpenSUSE at all, but in Ubuntu I think there are steps to bootstrap RVM into .bashrc. Is there any chance you missed steps during installation?

    Reply

Leave a Comment