This is quite a diversion, but it’s something that I want documented and indexed by the G00gles of the world in case someone else has a problem like me. If you are not interested in Ruby, or Rails, or RVM, skip this and will see you later on in the week!

Ruby!

Ruby!

I recently had an issue that stumped me (as well as the great folks in the #rvm channel on Freenode). In the process of setting up RVM, I initially made the mistake of doing it as root on a Debian (Squeeze) machine. Cautionary word, you are good playing with the system rubies provided by APT, but if you want to get to the bleeding edge, do all of your RVM installation and dev work as a user, not root. It caused some interesting conflicts. But no worries, this simple command completely reset my RVM setup (as in, I completely removed everything and started over):

# rvm implode

Fun name for a command, and boy does it work. Next, I went here and ran through their process of re-setting up RVM. Everything completed, and after a quick “rvm reload” I was able to see my RVM infrastructure fine. But trying to validate the ruby installed didn’t work. Doing a ruby -v gave me:

bash: /path/to/my/home/.rvm/rubies/ruby-2.0.0-p195/bin/ruby: No such file or directory

Yet, the file was there, permissions were correct, and by all accounts there should not be any errors. But as you can imagine, when you can’t run the ruby interpreter, nothing is going to work. Like NADA. After some tinkering with the guys on #rvm, they figured out that the binaries they assembled were at fault. So if you are ever in this situation, the command you want to run to avoid binaries and build from source is:

$ rvm reinstall 2.0.0-p195 --disable-binary

Provided you have all the tools needed to build a binary on your machine, this will grab the correct source and build it from scratch. Everything is beautiful now! Working like a champ:

$ ruby -v
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]

So there ya go. Hopefully you never end up getting this strange “No such file or directory” error, but if you do, try disabling a binary build.

This post originally appeared on BrandenWilliams.com.

Possibly Related Posts: