捆绑软件安装失败(错误:安装nokogiri时出错:错误:无法构建gem本机扩展)

时间:2018-11-29 13:27:17

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

我是红宝石的新手 我在执行命令时遇到问题:

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.

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

1 个答案:

答案 0 :(得分:0)

对不起,我是如此简单,我讨厌自己。仅仅是因为我可能已经使用sudo安装了某些东西,并且该权限仅适用于ROOT用户,所以我只是更改了文件的权限,仅此而已。 再次感谢您的帮助@drosam