繁体   English   中英

捆绑安装正在尝试安装不包含的gem?

[英]Bundle install is trying to install gems not included?

由于某些原因,当我进入

$ bundle install 

它输出此内容(Nokogiri不在此gemfile中)。 我是Mac的新手,所以可能与rvm有关。

Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.3.2
Using i18n 0.6.9
Using minitest 4.7.5
Using multi_json 1.10.1
Using thread_safe 0.3.3
Using tzinfo 0.3.39
Using activesupport 4.0.5
Using builder 3.1.4
Using erubis 2.7.0
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.0.5
Using mime-types 1.25.1
Using polyglot 0.3.4
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.0.5
Using activemodel 4.0.5
Using activerecord-deprecated_finders 1.0.3
Using arel 4.0.2
Using activerecord 4.0.5
Using bundler 1.6.2
Using mini_portile 0.6.0
Building nokogiri using packaged libraries.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/Harry/.rvm/rubies/ruby-2.0.0-p481/bin/ruby extconf.rb 
Building nokogiri using packaged libraries.
-----
libiconv is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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.

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=/Users/Harry/.rvm/rubies/ruby-2.0.0-p481/bin/ruby
    --help
    --clean
    --use-system-libraries
    --enable-static
    --disable-static
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --enable-cross-build
    --disable-cross-build

extconf failed, exit code 1

Gem files will remain installed in /Users/Harry/.rvm/gems/ruby-2.0.0-p481/gems/nokogiri-1.6.2.1 for inspection.
Results logged to /Users/Harry/.rvm/gems/ruby-2.0.0-p481/extensions/x86_64-darwin-13/2.0.0-static/nokogiri-1.6.2.1/gem_make.out
An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.2.1'` succeeds before bundling.

我什至尝试按照nokogiri网站上的指示进行操作(即使它不在此gemfile中),但仍然无法正常工作。 我什至还尝试在其他gemfile中注释掉nokogiri,以查看是否是问题所在,但仍然没有成功。

更新对于此目录中的某些原因,它给了我“此计算机上未安装滑轨”的信息,但是如果我从该目录CD出并键入rails -v,它就可以正常工作。

还有,你不要在Gemfile中包括一些宝石使用依赖宝石为自己的操作,如依赖宝石devise的宝石,你只包括这种宝石到你的宝石文件,但它具有与得到一起安装的依赖宝石devise的宝石,你可以检查Gemfile.lock文件中的依赖项gem,这是devise gem的示例

devise (3.2.0)
  bcrypt-ruby (~> 3.0)
  orm_adapter (~> 0.1)
  railties (>= 3.2.6, < 5)
  thread_safe (~> 0.1)
  warden (~> 1.2.3)

bcrypt-ruby和其他gem是依赖gem

首先,捆绑程序还(总是)安装您要安装的所有gem的所有要求。 要查看哪个宝石需要nokogiri,请查看Gemfile.lock ,因为它提供了所有已安装宝石,版本及其要求(包括版本)的完整列表。

要解决您的问题,您应该按照错误消息中的说明安装libiconv

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM