Error when installing Ruby on Rails: “Failed to build gem native extension”

后端 未结 10 1717
太阳男子
太阳男子 2020-12-28 13:29

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

10条回答
  •  情深已故
    2020-12-28 14:01

    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.

提交回复
热议问题