Tuesday, October 18, 2011

Problem with gmkdir when updating gems

Quick note on a problem I was seeing when I was trying to update gems in an rvm setup.

ruby-1.9.2-p290@demo ~: gem update
[...]
make install
/opt/local/bin/gmkdir -p /Users/crusso/.rvm/gems/ruby-1.9.2-p290@demo/gems/json-1.6.1/ext/json/ext/json/ext
make: /opt/local/bin/gmkdir: No such file or directory
make: *** [/Users/crusso/.rvm/gems/ruby-1.9.2-p290@demo/gems/json-1.6.1/ext/json/ext/json/ext] Error 1

I had no gmkdir in /opt/local/bin... no gmkdir at all. Previously, I had been using Macports, so I guess that ruby gems had cached the location to gmkdir.

Rather than blowing away my whole rvm installation and starting over, I installed the coreutils module with brew:

brew install coreutils
That includes gmkdir, but not in the right spot. So, I created a symbolic link to it:

sudo ln -s /usr/local/bin/gmkdir /opt/local/bin/gmkdir

Let me know if this problem was plaguing you and this helped.