I\'m running Crunchbang 11 (Debian-based).
I\'m trying to install Ruby on Rails, like this:
gem install rails --version 4.0.0
I ge
Rails 4.0 needs RubyGem version 2.0.3, Just update your system by using following command
gem update --system 2.0.3
Just a follow up ... on different solution...
it may be that you are on a mac and rails cannot find the right compiler for c headers.
just install xcode from apps store / homebrew or go to terminal ...
$ xcode-select --install
complete the installation and agree on the licensing etc, then ...
$ sudo gem install rails
I had the same error when installing rails, but I solved it by running the command: gem install rails
without adding sudo
.
Run the following command:
sudo apt-get install ruby-dev zlib1g-dev liblzma-dev
Then,
sudo gem install rails
For me this helped:
sudo apt-get install ruby-dev
For anyone got the error:"Failed to build gem native extension”, while running sudo gem install rails
, and it said somethings about "nokogiri".
It is possible because you are using the same ruby version as system is using (for mac user). The solution would be install RVM, use RVM to install another ruby version.
So now you have 2 Ruby versions on your machine, RVM will automatically switch to the newly installed version. now, you can run gem install rails
without error and without sudo
as well.