English 中文(简体)
安装 Jekyll - 土著扩展构建出错
原标题:Error Installing Jekyll - Native Extension Build

我无法安装 Jekyll 。 无法找到如何修补缺失的环节。 我想这是Ruby 的最新消息, 但RVM 也无法安装替代的红宝石版本 。

整个职位如下:

$ 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

这是否意味着我需要通过 rvm 来更新红宝石的版本?

最佳回答

您的问题在于, 您的系统不知道 make 位于何处, 或者您没有安装它。 最容易解决的办法是安装 xcode 。

您可以在?ls=1&mt=12 上找到狮子。或者用电脑在CD上找到较早版本。

如果您在使用狮子,请见下文有关如何在狮子上安装开发工具的注释。

问题回答

Ubuntu

  1. sudo apt-get install ruby-dev
  2. gem install jekyll

Need to install "make". I am using Ubuntu 12.10. sudo apt-get install make Should work on any Debian based distro.

注意 : 这个问题也出现在新式的 MacBook Pro 模型上, 这些模型与 Mavericks 预安装后一起出现。 我用自己的解决方案更新了另一篇文章, 完全不涉及 X code 。 我拿到机器时, 我的系统安装了 X code 开发工具 。

< a href=>https://stackoverflow.com/ questions/224601117/error-error-安裝-jekyll-error-failed-to-building-gem-native-extension/22398607#23298607>>ERROR:安装 Jekyll的错误:ERROR:建造本地宝石扩展失败

如果您尚未安装 X code, 请安装它 (< a href=" https:// developer. apple.com/xcode/" rel=" nofollow" > https:// developer. apple.com/xcode/ ) 。 < strong > Plus 您需要命令行工具 。

Open Xcode. 转到 Previews> 下载 > 安装命令行工具

安装 Xcode 命令行工具的 Xcode 安装命令行工具解决了我在Mac 上的问题

xcode-select -安装

  • sudo apt-get install ruby-dev
  • sudo gem install jekyll

希望这能帮上忙 跟我合作

在安装Jekyll时,我也有同样的错误,从这个链接的以下步骤帮助了我。以防有人发现!

http://davidensinger.com/2013/03/安裝-jekyll/

我在Fedora 22 设置中也遇到同样的问题。 我安装了 < code> ruby ,但没有 < code> ruby- devel 。 安装 < code> ruby- devel 为我确定了问题。

dnf install -y ruby-devel

旧系统:

yum install -y ruby-devel

I followed this on Ubuntu/Linux Mint

  1. sudo apt install build-essential
  2. sudo apt install ruby-dev
  3. sudo gem install jekyll

增编:您现在可以从山狮的App Store 上安装 < 坚固> XCode。 这一过程既透明又快速。

我和你也有同样的问题

我使用Mac OS X 10. 9 开发预览版本, 我安装了 gcc 和 Xcode 。

但我的Xcode版本是4.6

然后我安装Xcode 5.0

之后我又在终端中输入 sudo 宝石安装 Jekyll 。 然后就起作用了 。

希望它能帮到人

安装 Xcode 并安装命令工具!

Debian也有同样的问题, 我忘了执行这个命令:

~/.rvm/scripts/rvm

所有这些答案都对我没用。

如果您在ubuntu 14.04上寻找解决办法,请这样做:

sudo apt-get install ruby1.9.1-dev zlib1g-dev nodejs
sudo gem install jekyll -v 2.5.3

不幸的是,由于在Jekyll发生窃听事件,即使不需要JS引擎,也强制存在运行时的JS引擎,因此需要接听。

对于Ubuntu来说,

apt-get install libffi-dev

一条一般建议是只遵循显示出错误的原因,希望您能得到一个日志文件,其中第一行建议安装哪套软件包,在我的例子中:

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.21/mkmf.log

MacOS

我解决这个问题的办法

  1. install xcode
  2. type xcode-select --install in the command line
  3. type sudo gem install jekyll in the command line

PS:这是这个问题的两个答案的结合。

您正在丢失 Ruby- dev 文件, 请继续运行此命令 - sudo apt- get 安装 Ruby- dev

希望这能帮上忙!

我的macOS(10.14.2)也有同样的问题,原因可能是:

显然,与OSX el Capitan, 有一个新的安全功能, 防止您修改系统文件 名为“ 无根” 。

我的解决方案是使用 rvm:

  1. install ruby on Mac OS X with RVM
  2. gem install jekyll

在窗口上,我有一个问题

我实际上安装了版本的红宝石安装器-devkit 2.6.3-1-x64 红宝石

我已经把红宝石完全拆掉 安装了红宝石安装器 -devkit -2.5.5 -1-x64

在电壳上发布以下命令

gem install bundler
gem install jekyll

发现错误的位置

我有一个问题和所有的事情, 错误发生是因为我还没有同意一些更新的 xcode 服务条款。 运行下面的操作为我提供了诀窍。 去图 。

sudo xcodebuild -license accept

对于我来说,我不得不升级家庭brew,安装最新红宝石版本的rbenv 。之后,我在jekyll网站 上遵守了指令。我的OS是Catalina 2019,我无法安装Xcode,这还不能兼容!

您必须在 .bash_ profile 中设置路径, 以确保在您重新启动终端时初始化 rbenv

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

时当时

$ rbenv version
2.2.3 (set by /Users/mislav/.rbenv/version)
$ rbenv shell
rbenv: no shell-specific version configured

希望那帮助!

Here is the (only?) reliable and simple way to install Jekyll on macOS

  1. Install UTM
  2. Install Ubuntu Server
  3. Install Jekyll using Ubuntu instructions at https://jekyllrb.com/docs/installation/ubuntu/
  4. Forward port 22 in the VM settings (22->localhost->22)
  5. Use VS Code on the macOS host
  6. Install Remote SSH
  7. Connect to USER@localhost
  8. Drag and drop the folder on Mac into VS Code (this transfers files to remote)
  9. Enable port forwarding for 4000 (bottom bar on VS Code)
  10. Work on your website
  11. Right click on your website on the file explorer and click download

如果你没有采取这些步骤,你可能会很高兴:

  1. Ubuntu imports your public SSH key from GitHub
  2. VS Code magically handles file transfer in and out
  3. VS Code magically installs your VS Code extensions onto the remote server and allows file search on the remote host




相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签