简体   繁体   English

在Raspbian上安装Ruby Gem错误:无法构建Gem本机扩展

[英]Installing Ruby Gem on Raspbian Error: Failed to Build Gem Native Extension

I'm trying to install a ruby gem ( Jekyll ) and I keep getting the following error. 我正在尝试安装一个宝石红宝石( Jekyll ),并且不断出现以下错误。

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. 我正在使用Raspberry Pi。 When asking Ruby it's version, I get the following: 当询问Ruby的版本时,我得到以下信息:

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: 几个小时前,我通过运行以下命令安装了最新版本的Ruby:

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 ). 为了找出问题的根源,我尝试安装其他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. 因此,我在这里这里都研究了关于StackOverflow的其他问题,我发现这是因为我拥有的Ruby版本。 Even if I installed the latest RVM, I had to install the correct version of Ruby by running the command: 即使安装了最新的RVM,也必须通过运行以下命令来安装正确版本的Ruby:

sudo apt-get install ruby1.9.1-dev

Solved my problem. 解决了我的问题。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM