在Raspbian错误上安装Ruby Gem:无法构建Gem原生扩展 [英] Installing Ruby Gem on Raspbian Error: Failed to Build Gem Native Extension
问题描述
我试图安装一个ruby gem( Jekyll ),并且我一直收到以下错误。
错误:安装jekyll时出错:
错误:无法构建gem原生扩展。
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in`require':can not load such file - mkmf(LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in`require'
from extconf.rb:1:in<<主>'
我正在使用Raspberry Pi。在询问Ruby的版本时,我得到以下内容:
user @ raspberrypi〜$ ruby -version
ruby 1.9。 3p194(2012-04-20修订版35410)[arm-linux-eabihf]
-e:1:在< main>中:未定义的局部变量或方法'rsion'for main:Object(NameError)
几小时前,我运行以下命令安装了最新版本的Ruby:
sudo curl -L https://get.rvm.io | bash -s stable --ruby
为了找出问题的根源,我尝试安装不同的宝石( lolcat )。它安装成功,并完美地工作。
我做错了什么?
预先感谢您!
所以,我已经研究了StackOverflow上的其他问题解决方案/ unable-to-install-gem-failed-to-build-gem-native-extension-can-load-such?rq = 1> here and 这里,我发现这是因为Ruby的版本我有。即使我安装了最新的RVM,我也必须运行以下命令来安装正确版本的Ruby:
$ b
sudo apt-get安装ruby1.9.1-dev
解决了我的问题。 :)
I'm trying to install a ruby gem (Jekyll) and I keep getting the following error.
ERROR: Error installing jekyll:
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>'
I'm using a Raspberry Pi. When asking Ruby it's version, I get the following:
user@raspberrypi ~ $ ruby -version
ruby 1.9.3p194 (2012-04-20 revision 35410) [arm-linux-eabihf]
-e:1:in `<main>': undefined local variable or method `rsion' for main:Object (NameError)
A few hours ago, I installed the latest version of Ruby by running the command:
sudo curl -L https://get.rvm.io | bash -s stable --ruby
To find out the source of the problem I tried installing a different gem (lolcat). It installed successfully and works perfectly.
What am I doing wrong?
Thank you in advance!
So, I've looked into other questions on StackOverflow here and here, and I found out it was because of the version of Ruby that I had. Even if I installed the latest RVM, I had to install the correct version of Ruby by running the command:
sudo apt-get install ruby1.9.1-dev
Solved my problem. :)
这篇关于在Raspbian错误上安装Ruby Gem:无法构建Gem原生扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!