【问题标题】:An error occurred while installing commonmarker (0.17.13), and Bundler cannot continue安装 commonmarker (0.17.13) 时出错,Bundler 无法继续
【发布时间】:2020-01-16 19:42:06
【问题描述】:

问题:通过终端执行bundle install 时,无法安装依赖项。

日志(部分)

   Password: 
Installing commonmarker 0.17.13 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/tmp/bundler20190915-6718-b0qbe8commonmarker-0.17.13/gems/commonmarker-0.17.13/ext/commonmarker
/usr/bin/ruby2.3 -r ./siteconf20190915-6718-1610j54.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in
/tmp/bundler20190915-6718-b0qbe8commonmarker-0.17.13/gems/commonmarker-0.17.13
for inspection.
Results logged to
/tmp/bundler20190915-6718-b0qbe8commonmarker-0.17.13/extensions/x86_64-linux/2.3.0/commonmarker-0.17.13/gem_make.out

An error occurred while installing commonmarker (0.17.13), and Bundler
cannot continue.
Make sure that `gem install commonmarker -v '0.17.13' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  github-pages was resolved to 198, which depends on
    jekyll-commonmark-ghpages was resolved to 0.1.5, which depends on
      jekyll-commonmark was resolved to 1.3.1, which depends on
        commonmarker

操作系统:GNU/Linux

gem -v:2.5.2.1

ruby -v:ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]

【问题讨论】:

  • 在捆绑之前确保gem install commonmarker -v '0.17.13' --source 'https://rubygems.org/'成功。

标签: rubygems jekyll bundler


【解决方案1】:

这对我来说很好用:

$ cd APP_ROOT
$ su
# apt install rbenv
# rbenv global
# gem install bundler
# rbenv rehash
# gem clean
$ bunlde install

【讨论】:

    【解决方案2】:

    这为我解决了:

    sudo apt-get install ruby-dev
    

    紧随其后

    bundle install
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-14
      • 2022-01-20
      • 2017-02-09
      • 2018-09-08
      • 2021-06-25
      • 2014-01-12
      • 2018-04-05
      • 2020-05-07
      相关资源
      最近更新 更多