0

I tried to switch from managing my Ruby gems on OSX with rvm to rbenv by first removing rvm. rbenv never seemed to take over, which ruby or which rails always returned the system version.

Frustrated and sleep deprived, I decided to remove /usr/bin/rails to see if that would force the system to use the version specified in rbenv, which it did not and now rails isn't found at all.

Emmaline:rvm Turnsole$ which ruby
/usr/bin/ruby
Emmaline:rvm Turnsole$ which rails
Emmaline:rvm Turnsole$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
Emmaline:rvm Turnsole$ rails -v
-bash: rails: command not found
Emmaline:rvm Turnsole$ 

I realize that what I did was stupid, but now even though gem install rails completes sucessfully there is nothing at /usr/bin/rails.

In addition, after reinstalling rvm, I try to run the rails script located in my local gems directory (or symlink to it from /usr/bin) then this happens:

Emmaline:~ Turnsole$ ~/.gem/ruby/1.8/bin/rails
env: ruby_noexec_wrapper: No such file or directory

What should I do?

1 Answer 1

1

I'm still not completely sure what all went wrong, but it appears that rvm installed bundler, which messed things up when it went away because of ruby_noexec_wrapper (which belongs to bundler) being inserted into all kinds of things.

Ultimately the solution was to uninstall bundler, then railties (which removed rails from my local dir) and then reinstall rails using sudo.

At any rate, now I have /usr/bin/rails back. I'd like to understand why/how this ruby_noexec_wrapper script became part of all my gems, but that's another question that google will probably provide.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.