ruby 安装 Jekyll - Native Extension Build 时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10725767/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error Installing Jekyll - Native Extension Build
提问by Robb Schiller
I'm having some trouble installing jekyll. Can't quite figure out how to patch the missing link. I think it's an update to Ruby, but RVM is having trouble installing alternate versions of ruby as well.
我在安装 jekyll 时遇到了一些问题。无法弄清楚如何修补丢失的链接。我认为这是对 Ruby 的更新,但 RVM 也无法安装 ruby 的替代版本。
Heres the full post:
这是完整的帖子:
$ sudo gem install jekyll
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1/ext/gem_make.out
Does this mean I need to update the version of ruby I'm using via rvm?
这是否意味着我需要通过 rvm 更新我正在使用的 ruby 版本?
采纳答案by Noah Clark
Your problem is that either you system doesn't know where make is located at or you don't have it installed. The easiest way to fix this (and probably other issues you'll run into trying to get a ruby system up and running) is to install xcode.
您的问题是您的系统不知道 make 所在的位置,或者您没有安装它。解决此问题的最简单方法(以及您在尝试启动和运行 ruby 系统时可能会遇到的其他问题)是安装 xcode。
You can get it at http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12for lion. Or it came on a CD with your computer for earlier versions.
您可以在http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12for lion 上获得它。或者它与您的计算机的 CD 一起提供早期版本。
If you're using Lion, please see comments below for a link to how to install developer tools on Lion.
如果您使用的是 Lion,请参阅下面的评论以获取有关如何在 Lion 上安装开发人员工具的链接。
回答by Nmzzz
Ubuntu
Ubuntu
sudo apt-get install ruby-devgem install jekyll
sudo apt-get install ruby-devgem install jekyll
回答by Mayas
回答by Sebastian
If you installed XCode and command line tools are stillmissing go to Terminal and
如果您安装了 XCode 并且仍然缺少命令行工具,请转到终端并
xcode-select --install
xcode-select --install
it will prompt you to install these tools. After that just follow SrBlanco′sanswer. That solved the problem for me.
它会提示您安装这些工具。之后只需按照SrBlanco 的回答即可。那为我解决了问题。
Good luck.
祝你好运。
回答by digitalr00ts
Need to install "make".
I am using Ubuntu 12.10.
sudo apt-get install makeShould work on any Debian based distro.
需要安装“make”。我正在使用 Ubuntu 12.10。
sudo apt-get install make应该适用于任何基于 Debian 的发行版。
回答by SrBlanco
Note: this problem also occurs on newer MacBook Pro models that come with Mavericks pre-installed. I updated another post with my own solution that didn't involve Xcode at all. My system had the Xcode developer tools installed when I got the machine.
注意:此问题也会出现在预装 Mavericks 的较新 MacBook Pro 机型上。我用我自己的解决方案更新了另一篇文章,根本不涉及 Xcode。当我拿到机器时,我的系统安装了 Xcode 开发人员工具。
ERROR: Error installing jekyll: ERROR: Failed to build gem native extension
回答by Shuai.Z
- sudo apt-get install ruby-dev
- sudo gem install jekyll
- sudo apt-get install ruby-dev
- 须藤宝石安装 jekyll
hope this will help, it works with me.
希望这会有所帮助,它对我有用。
回答by Ajay Gautam
Installing command line tools for Xcode solved the problem for me on my Mac
为 Xcode 安装命令行工具解决了我在 Mac 上的问题
xcode-select --install.
xcode-select --install.
回答by j7nn7k
Install Xcode as mentioned if you don't have it installed already (https://developer.apple.com/xcode/). Plusyou need the command line tools.
如果您还没有安装 Xcode,请按照所述安装 Xcode ( https://developer.apple.com/xcode/)。另外,您需要命令行工具。
Open Xcode. Go to Preferences > Downloads > Install Command Line Tools
打开 Xcode。去Preferences > Downloads > Install Command Line Tools
回答by Joydip Datta
I was facing the same issue in my Fedora 22 setup. I had rubyinstalled but didn't have ruby-devel. Installing ruby-develfixed the issue for me.
我在 Fedora 22 设置中遇到了同样的问题。我已经ruby安装了,但没有ruby-devel。安装ruby-devel为我解决了这个问题。
dnf install -y ruby-devel
For older systems:
对于旧系统:
yum install -y ruby-devel

