Parece que no puedo "usar" la instalación de RVM Ruby

I'm getting this error when I try to invoke rails, rails -v or rails -c:

/usr/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
    from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:214:in `activate'
    from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1082:in `gem'
    from /usr/bin/rails:18

I installed RVM, used it to install Ruby 1.9.3, and switched to it rvm use 1.9.3 --default.

Cuando ruby -v:

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

Yo también gem install rails --no-rdoc --no-ri and ~/ruby/gems/gems/:

actionmailer-3.2.8/    journey-1.0.4/     rake-
actionpack-3.2.8/      json-1.7.5/        rdoc-3.12/
activemodel-3.2.8/     mail-2.4.4/        rubygems-bundler-1.0.7/
activerecord-3.2.8/    mime-types-1.19/   rvm-
activeresource-3.2.8/  multi_json-1.3.6/  sprockets-2.1.3/
activesupport-3.2.8/   polyglot-0.3.3/    sprockets-2.4.5/
arel-3.0.2/            rack-1.4.1/        thor-0.16.0/
builder-3.0.0/         rack-cache-1.2/    tilt-1.3.3/
bundler-1.1.5/         rack-ssl-1.3.2/    treetop-1.4.10/
erubis-2.7.0/          rack-test-0.6.1/   tzinfo-0.3.33/
hike-1.2.1/            rails-3.2.8/
i18n-0.6.0/            railties-3.2.8/

Y si yo echo $GEM_PATH:


echo $PATH:


cat ~/.bashrc:

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc

# User specific aliases and functions

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

cat ~/.bash_profile:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc

# User specific environment and startup programs


export PATH

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

So somewhere something has a path that says to look at the system Ruby install. Any ideas? Thanks!


Okay, also, If i switch back to the system Ruby, rvm use system y rails -v, Yo obtengo:

Rails 2.3.8

So I have no idea at all what this error is indicating.

preguntado el 24 de agosto de 12 a las 09:08

the error means the ruby used there still version 1.8, the version shipped with the system, not the rvm one. So how did you get that error? -

Seems rvm is installed correctly. have a try to source .rvm/scripts/rvm. If that can't fix, check $PATH, the system install must be there somewhere. I guess you could uninstall that. -

I can't uninstall the system Ruby install (shared hosting), plus I shouldn't have to. That's the purpose of RVM. -

Just check the source operation and $PATH, make sure rvm is in $PATH. -

4 Respuestas

You have not completed rvm installation. You need add ~/.rvm bin paths before /usr/bin by command in .bashrc:

[[ -s "/Users/pftg/.rvm/scripts/rvm" ]] && source "/Users/pftg/.rvm/scripts/rvm".

To test just check $PATH env. Should be similar to:


Respondido 24 ago 12, 09:08

If you installed everything ruby as well as rails means, you may need to select the 'Run command as login shell' checkbox by doing following,

  1. Terminal abierta
  2. Go to Edit tab, then select Profile Preferences from the menu item.
  3. The Profile Preferences window should be displayed, then select Title and Command tab.
  4. Then select the checkbox Run command as a login shell.

Respondido 24 ago 12, 11:08

I'm on OS X logging into a linux webhost via SSH. - jared_flack

I just used RVM to create a "gemset", switched to it, and tried installing Rails again and it works now.

I'm not sure why that fixed it or why it wasn't working before. I like when things work, but I would rather have figured out why it wasn't working with the @global conjunto de gemas

¡Gracias por toda tu ayuda!

Respondido 25 ago 12, 08:08

I had the exact symptoms described above as well and was stuck on this problem for quite some time (the ruby environment and dependencies are a horrible mess). I can't say I'm out of the woods yet but at least I'm picking up the correct version of rails now and gotten past this error.

I believe the real issue here is actually to do with zlib. It seems that it's a crucial component to separate your system version of ruby (v1.8 likely install via yum/apt-get) with the other versions or Ruby you need (installed via rvm) for other projects.

If you do not have zlib installed, or rvm is not using it correctly, then sometimes you will pick up the system ruby/rails and all sorts of strange errors occur.

Si DO have zlib installed (yum/apt-get install zlib) then the trick I discovered was that I specifically had to tell rvm which version of zlib to use when installing ruby.

rvm install 1.9.3 --with-zlib-dir=$rvm_path/usr

contestado el 05 de mayo de 14 a las 10:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.