本文介绍了在Ubuntu 14.04上安装Jekyll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我在Ubuntu上安装Jekyll时遇到了一些问题。以下是我的一些版本: trevor〜$ ruby -v ruby 2.2.4p230(2015- 12-16修订版53155)[x86_64-linux] trevor〜$ gem -v 2.5.1 trevor〜$ rvm -v rvm 1.26.11(latest)by Wayne E. Seguin< [email protected]>,Michal Papis< [email protected]> [https://rvm.io/] 但是,当我尝试安装Jekyll时,这些错误: trevor〜$ gem install jekyll 构建本机扩展。这可能需要一段时间... 错误:安装jekyll时出错:错误:无法构建gem本机扩展。 当前目录:/home/trevor/.rvm/gems/ruby-2.2.4/gems/ffi-1.9.10/ext/ffi_c /home/trevor/.rvm/ rubies-2.2.4 / bin / ruby -r ./siteconf20151229-11854-1czjp2r.rb extconf.rb *** extconf.rb失败*** 由于某些原因无法创建Makefile原因,可能缺乏必要的库和/或标题。检查mkmf.log文件以获取更多详细信息。您可能需要配置选项。 提供的配置选项: --with-opt-dir --without-opt-dir --with-opt-include - -without-opt-include = $ {opt-dir} / include --with-opt-lib --without-opt-lib = $ {opt-dir} / lib --with-make-prog --without-make-prog --srcdir =。 --curdir --ruby = / home / trevor / .rvm / rubies / ruby-2.2.4 / bin / $(RUBY_BASE_NAME) --with-ffi_c-dir --without -ffi_c-dir --with-ffi_c -include --without -ffi_c-include = $ {ffi_c-dir} /include --with-ffi_c- lib --without -ffi_c-lib = $ {ffi_c-dir} / lib --with-libffi-config --without-libffi-config --with -pkg-config --without-pkg-config /home/trevor/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:456:in `try_do':编译器无法生成可执行文件。 (RuntimeError)您必须先安装开发工具。从/ home / trevor /中的/home/trevor/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:541:in`try_link0' 。 rvm / rubies / ruby-2.2.4 / lib / ruby / 2.2.0 / mkmf.rb:556:在`try_link' from /home/trevor/.rvm/rubies/ruby-2.2.4/lib /ruby/2.2.0/mkmf.rb:637:in`try_ldflags' from /home/trevor/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb: 1780:在`pkg_config'从extconf.rb:15:在`< main>' 中查看这个扩展名编译失败的原因,请检查mkmf.log,它可以是在这里找到: /home/trevor/.rvm/gems/ruby-2.2.4/extensions/x86_64-linux/2.2.0/ffi-1.9.10/mkmf.log extconf失败,退出代码1 Gem文件将保留安装在/home/trevor/.rvm/gems/ruby-2.2.4/gems/ffi-1.9.10中进行检查。 记录到/home/trevor/.rvm/gems/ruby-2.2.4/extensions/x86_64-linux/2.2.0/ffi-1.9.10/gem_make.out trevor〜$ sudo gem install jekyll 错误:安装jekyll时出错: jekyll需要Ruby版本> = 2.0.0。 我曾尝试安装多个版本的ruby-dev,似乎也没有帮助。 trevor〜$ sudo apt-get install ruby2.2.4-dev 正在读取软件包列表...完成构建依赖关系树读取状态信息...完成 E:无法找到包ruby2.2.4-dev E:找不到正则表达式的任何包ruby2.2.4- dev' 同样的事情发生在 ruby2.0.0-dev 。 运行 sudo apt-get install ruby-dev 似乎会安装 1.9.3.4 。无论如何,我仍然遇到上述相同的问题。 有什么想法? 编辑 这是我的rvm清单: trevor〜$ rvm list rvm rubies ruby-2.0.0-p643 [x86_64] ruby-2.2.1 [x86_64] = * ruby-2.2.4 [x86_64] #=> - 当前#= * - 当前&&默认#* - 默认 我尝试安装几个不同的版本。这会导致问题吗? 解决方案 否 1: gpg --keyserver hkp://keys.gnupg .net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 2: \curl -sSL https://get.rvm.io | bash #install RVM(开发版本) rvm get head #确保RVM保持最新状态 4: rvm install ruby #将安装最新版本的ruby 5: rvm list #上面的安装红宝石将获得由RVM安装的ruby版本 6: rvm使用< ruby-version> #for instance ruby-1.9.3-p125 7: gem install jekyll 编辑更新你在senerio编辑答案 trevor〜$ rvm list rvm红宝石 ruby-2.0.0-p643 [x86_64] ruby-2.2.1 [x86_64] = * ruby-2.2.4 [x86_64] rvm use 2.2.1 gem install jekyll 可以工作!!! I've been having some issues installing Jekyll on Ubuntu. Here are some of the versions I have:trevor~$ ruby -vruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]trevor~$ gem -v2.5.1trevor~$ rvm -vrvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]However, when I try to install Jekyll, I get these errors:trevor~$ gem install jekyllBuilding native extensions. This could take a while...ERROR: Error installing jekyll: ERROR: Failed to build gem native extension. current directory: /home/trevor/.rvm/gems/ruby-2.2.4/gems/ffi-1.9.10/ext/ffi_c/home/trevor/.rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20151229-11854-1czjp2r.rb extconf.rb*** extconf.rb failed ***Could not create Makefile due to some reason, probably lack of necessarylibraries and/or headers. Check the mkmf.log file for more details. You mayneed configuration options.Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/trevor/.rvm/rubies/ruby-2.2.4/bin/$(RUBY_BASE_NAME) --with-ffi_c-dir --without-ffi_c-dir --with-ffi_c-include --without-ffi_c-include=${ffi_c-dir}/include --with-ffi_c-lib --without-ffi_c-lib=${ffi_c-dir}/lib --with-libffi-config --without-libffi-config --with-pkg-config --without-pkg-config/home/trevor/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)You have to install development tools first. from /home/trevor/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0' from /home/trevor/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:556:in `try_link' from /home/trevor/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:637:in `try_ldflags' from /home/trevor/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:1780:in `pkg_config' from extconf.rb:15:in `<main>'To see why this extension failed to compile, please check the mkmf.log which can be found here: /home/trevor/.rvm/gems/ruby-2.2.4/extensions/x86_64-linux/2.2.0/ffi-1.9.10/mkmf.logextconf failed, exit code 1Gem files will remain installed in /home/trevor/.rvm/gems/ruby-2.2.4/gems/ffi-1.9.10 for inspection.Results logged to /home/trevor/.rvm/gems/ruby-2.2.4/extensions/x86_64-linux/2.2.0/ffi-1.9.10/gem_make.outOr if I use sudo:trevor~$ sudo gem install jekyllERROR: Error installing jekyll: jekyll requires Ruby version >= 2.0.0.I have tried installing multiple versions of ruby-dev as recommended by others with a similar issue, but this hasn't seemed to help either. trevor~$ sudo apt-get install ruby2.2.4-devReading package lists... DoneBuilding dependency treeReading state information... DoneE: Unable to locate package ruby2.2.4-devE: Couldn't find any package by regex 'ruby2.2.4-dev'Same thing happens with ruby2.0.0-dev.Running sudo apt-get install ruby-dev seems to install 1.9.3.4. Regardless, I still run into the same issues above.Any ideas?EDITHere is my rvm list:trevor~$ rvm listrvm rubies ruby-2.0.0-p643 [ x86_64 ] ruby-2.2.1 [ x86_64 ]=* ruby-2.2.4 [ x86_64 ]# => - current# =* - current && default# * - defaultI did try installing a couple different versions. Would this cause a problem? 解决方案 NoFollow the given step would help.1: gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E32: \curl -sSL https://get.rvm.io | bash # install RVM (development version)3: rvm get head # Make Sure RVM up to date4: rvm install ruby # will install latest version of ruby5: rvm list # Listing install rubies will you get versions of ruby which is installed by RVM6: rvm use < ruby-version > # for instances ruby-1.9.3-p1257: gem install jekyllEdit Update As you edited answer in your seneriotrevor~$ rvm listrvm rubies ruby-2.0.0-p643 [ x86_64 ] ruby-2.2.1 [ x86_64 ]=* ruby-2.2.4 [ x86_64 ]rvm use 2.2.1gem install jekyllWould work !!! 这篇关于在Ubuntu 14.04上安装Jekyll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-29 11:17