【问题标题】:bundle install failed (ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension)捆绑安装失败(错误:安装 nokogiri 时出错:错误:无法构建 gem 原生扩展)
【发布时间】:2018-11-29 13:27:16
【问题描述】:

我是红宝石的新手 我无法执行命令:

bundle install

我正在使用 FEDORA28 并已使用 rvm 安装了 ruby​​,但显然缺少某些内容或权限错误,但我不明白。 我有这个答案:

Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.0.0
Using concurrent-ruby 1.0.5
Using i18n 0.8.6
Using minitest 5.10.3
Using thread_safe 0.3.6
Using tzinfo 1.2.3
Using activesupport 5.1.3
Using builder 3.2.3
Using erubi 1.6.1
Using mini_portile2 2.2.0
Fetching nokogiri 1.8.0
Installing nokogiri 1.8.0 with native extensions
Errno::EACCES: Permission denied @ rb_sysopen -
/home/BFournier/Documents/Boris/rothenberg/benchmark-headless-chrome- 
vs-phantomjs/vendor/bundle/ruby/2.5.0/extensions/x86_64- 
linux/2.5.0/nokogiri-1.8.0/gem_make.out
An error occurred while installing nokogiri (1.8.0), and Bundler 
cannot continue.
Make sure that `gem install nokogiri -v '1.8.0' --source 
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  rails was resolved to 5.1.3, which depends on
    actioncable was resolved to 5.1.3, which depends on
      actionpack was resolved to 5.1.3, which depends on
        actionview was resolved to 5.1.3, which depends on
          rails-dom-testing was resolved to 2.0.3, which depends on
            nokogiri

当我尝试执行此操作时:

gem install nokogiri -v '1.8.0' --source 'https://rubygems.org/'

我有这个:

ERROR:  Error installing nokogiri:
ERROR: Failed to build gem native extension.

current directory: /home/BFournier/.gem/ruby/gems/nokogiri- 
1.8.0/ext/nokogiri
/usr/bin/ruby -r ./siteconf20181129-21800-1ke3w2r.rb extconf.rb
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of 
necessary
libraries and/or headers.  Check the mkmf.log file for more details.  
You may need configuration options.

我发现了一些类似的问题,但我尝试的所有方法目前都不起作用。 提前感谢任何线索。

【问题讨论】:

标签: ruby-on-rails nokogiri fedora-28


【解决方案1】:

愚蠢的我,太简单了,我讨厌自己。只是我可能已经用 sudo 安装了一些东西,并且权限仅适用于 ROOT 用户,所以我刚刚更改了文件的权限,仅此而已。 再次感谢您的帮助@drosam

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-08-18
    • 2020-03-01
    • 1970-01-01
    • 2015-03-06
    • 2011-12-12
    • 2014-12-28
    • 2019-03-10
    相关资源
    最近更新 更多