0

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

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

4 Comments

It says that Debian doesn't support that command because it could possibly break my computer. Any ideas?
What Ruby version you have?
Another point to mention, use @tompave's answer to get RVM and install Ruby 2.2.2 or your version of preference.
Below the vote up/down buttons, there is a check button and click it to award the user for the most helpful answer.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.