Reputation: 167
Ubuntu is such a pain sometimes. I am trying to install a specific version of rails (4.2.2) for the Rails tutorial I am doing and my commandline is screaming this code at me in response. Could someone point me in the right direction? Thank you.
I first put...
sudo gem install rails -v 4.2.2
and then I get this big ugly thing...
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.8.3 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/json-1.8.3/ext/json/ext/generator/gem_make.out
Upvotes: 0
Views: 820
Reputation: 12412
You might want to look at this question.
Also, you seem to be using a default system ruby installed via apt-get
. Consider using rvm instead, as it automatically takes care of installing missing dependencies via your package manager.
Upvotes: 1
Reputation: 614
You may want to update your RubyGems because Rails 4.2 requires the latest version of RubyGems. Run gem update --system
to get the latest dependencies and then gem install rails -v 4.2.2
and the error should go away.
Upvotes: 1