簡體   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