stillmotion
stillmotion

Reputation: 4628

gem install LibXML-Ruby Native extension fails to build under RVM 1.9.2

I am trying to gem install libxml-ruby under RVM's 1.9.2-p0 on a Snow Leopard installation. The build process of the native extension, however, halts with this error:

~/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/mkmf.rb:368:in 'try_do': The complier failed to generate an executable file. (RuntimeError) You have to install development tools first.

I'm not sure where exactly to start in terms of debugging this issues, but if anyone has a hint at a solution, I would much appreciate it. Here is a full dump of the log: https://gist.github.com/3b13bf6f66f5bd6033ca.

Upvotes: 1

Views: 1338

Answers (1)

the Tin Man
the Tin Man

Reputation: 160581

The message:

You have to install development tools first.

means you don't have Apple's XCode development environment installed. You can download it from Apple's XCode site with a free registration.

The XCode environment is also included with the Snow Leopard DVD, but it was buggy, so download the latest version.

Your question isn't exactly clear though. RVM isn't anywhere near a 1.9.2 release, so I think you mean "Ruby 1.9.2-p0". If so, then I'm not sure how you got Ruby installed under RVM's control without the development environment unless... did you run sudo or su to root before trying to install LibXML? If so, that is potentially the problem as you're never supposed to install gems under RVMs control using sudo if you're running a single-user version of RVM.

If you're sure all your existing RVM and Ruby and XCode are good, try rvm package install libxml2.

Also, as a safety tip, remember to periodically run rvm get head to make sure its current. I run it every other day, but weekly or monthly should be good.

Upvotes: 2

Related Questions