2015-07-10 86 views
1

我正在使用IDE Cloud9并希望升级Ruby版本(从2.1.5到2.2.1)。在安装RVM后,我说rvm use 2.2.1并将Gemfile中的Ruby版本更改为2.2.1。然后我跑bundle install,并得到以下结果:更新Ruby版本和gems,gem更新失败

Fetching gem metadata from https://rubygems.org/.......... 
Fetching version metadata from https://rubygems.org/... 
Fetching dependency metadata from https://rubygems.org/.. 
Fetching https://github.com/leikind/wice_grid.git 
Using rake 10.4.2 
Installing CFPropertyList 2.3.1 
Installing i18n 0.7.0 
Installing json 1.8.3 
Installing minitest 5.7.0 
Installing thread_safe 0.3.5 
Installing tzinfo 1.2.2 
Installing activesupport 4.2.3 
Installing builder 3.2.2 
Installing erubis 2.7.0 
Installing mini_portile 0.6.2 

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

    /usr/local/rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150710-9483-je82d8.rb extconf.rb 
checking if the C compiler accepts ... yes 
Building nokogiri using packaged libraries. 
checking for gzdopen() in -lz... yes 
checking for iconv... yes 
************************************************************************ 
IMPORTANT NOTICE: 

Building Nokogiri with a packaged version of libxml2-2.9.2 
with the following patches applied: 
     - 0001-Revert-Missing-initialization-for-the-catalog-module.patch 
     - 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch 

Team Nokogiri will keep on doing their best to provide security 
updates in a timely manner, but if this is a concern for you and want 
to use the system library instead; abort this installation process and 
reinstall nokogiri as follows: 

    gem install nokogiri -- --use-system-libraries 
     [--with-xml2-config=/path/to/xml2-config] 
     [--with-xslt-config=/path/to/xslt-config] 

If you are using Bundler, tell it to use the option: 

    bundle config build.nokogiri --use-system-libraries 
    bundle install 

Note, however, that nokogiri is not fully compatible with arbitrary 
versions of libxml2 provided by OS/package vendors. 
************************************************************************ 
Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxml2/0001-Revert-Missing-initialization-for-the-catalog-module.patch... 
Running 'patch' for libxml2 2.9.2... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxml2/0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch... 
Running 'patch' for libxml2 2.9.2... OK 
Running 'configure' for libxml2 2.9.2... OK 
Running 'compile' for libxml2 2.9.2... OK 
Running 'install' for libxml2 2.9.2... OK 
Activating libxml2 2.9.2 (from /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/x86_64-unknown-linux-gnu/libxml2/2.9.2)... 
************************************************************************ 
IMPORTANT NOTICE: 

Building Nokogiri with a packaged version of libxslt-1.1.28 
with the following patches applied: 
     - 0001-Adding-doc-update-related-to-1.1.28.patch 
     - 0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch 
     - 0003-Initialize-pseudo-random-number-generator-with-curre.patch 
     - 0004-EXSLT-function-str-replace-is-broken-as-is.patch 
     - 0006-Fix-str-padding-to-work-with-UTF-8-strings.patch 
     - 0007-Separate-function-for-predicate-matching-in-patterns.patch 
     - 0008-Fix-direct-pattern-matching.patch 
     - 0009-Fix-certain-patterns-with-predicates.patch 
     - 0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch 
     - 0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch 
     - 0014-Fix-for-bug-436589.patch 
     - 0015-Fix-mkdir-for-mingw.patch 

Team Nokogiri will keep on doing their best to provide security 
updates in a timely manner, but if this is a concern for you and want 
to use the system library instead; abort this installation process and 
reinstall nokogiri as follows: 

    gem install nokogiri -- --use-system-libraries 
     [--with-xml2-config=/path/to/xml2-config] 
     [--with-xslt-config=/path/to/xslt-config] 

If you are using Bundler, tell it to use the option: 

    bundle config build.nokogiri --use-system-libraries 
    bundle install 
************************************************************************ 
Extracting libxslt-1.1.28.tar.gz into tmp/x86_64-unknown-linux-gnu/ports/libxslt/1.1.28... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0001-Adding-doc-update-related-to-1.1.28.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0003-Initialize-pseudo-random-number-generator-with-curre.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0004-EXSLT-function-str-replace-is-broken-as-is.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0006-Fix-str-padding-to-work-with-UTF-8-strings.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0007-Separate-function-for-predicate-matching-in-patterns.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0008-Fix-direct-pattern-matching.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0009-Fix-certain-patterns-with-predicates.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0014-Fix-for-bug-436589.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0015-Fix-mkdir-for-mingw.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running 'configure' for libxslt 1.1.28... OK 
Running 'compile' for libxslt 1.1.28... ERROR, review '/usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxslt/1.1.28/compile.log' to see what happened. 
*** 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=/usr/local/rvm/rubies/ruby-2.2.1/bin/$(RUBY_BASE_NAME) 
     --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 
/usr/local/rvm/gems/ruby-2.2.1/gems/mini_portile-0.6.2/lib/mini_portile.rb:279:in `block in execute': Failed to complete compile task (RuntimeError) 
     from /usr/local/rvm/gems/ruby-2.2.1/gems/mini_portile-0.6.2/lib/mini_portile.rb:271:in `chdir' 
     from /usr/local/rvm/gems/ruby-2.2.1/gems/mini_portile-0.6.2/lib/mini_portile.rb:271:in `execute' 
     from /usr/local/rvm/gems/ruby-2.2.1/gems/mini_portile-0.6.2/lib/mini_portile.rb:70:in `compile' 
     from /usr/local/rvm/gems/ruby-2.2.1/gems/mini_portile-0.6.2/lib/mini_portile.rb:110:in `cook' 
     from extconf.rb:278:in `block in process_recipe' 
     from extconf.rb:177:in `tap' 
     from extconf.rb:177:in `process_recipe' 
     from extconf.rb:487:in `<main>' 

extconf failed, exit code 1 

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.6.2 for inspection. 
Results logged to /usr/local/rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/nokogiri-1.6.6.2/gem_make.out 
An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue. 
Make sure that `gem install nokogiri -v '1.6.6.2'` succeeds before bundling. 

此外,CLOUD9生成一个弹出disk quota reached(我有超过200MB的可用空间运行bundle install之前,我试图运行gem install nokogiri -v '1.6.6.2'就像在年底的错误消息。我想这可能是由于缺少磁盘配额,但我不确定,我尝试使用gem cleanuprake tmp:clear进行清理,但这些会生成错误:Could not find nokogiri-1.6.6.2 in any of the sources. Run 'bundle install' to install missing gems.我应该如何处理这个错误消息?从这里取得进展?

+0

当您升级时,您是否从rvm中删除旧的ruby版本?可能能够清理那里的一些空间(我不知道那么多有关云9,所以可能不会被计算在内)。 – Doon

+0

啊对不起,我误读了栈跟踪,它是[mini_portile](https:// github。 COM/flavorjones/mini_portile)。试试'gem install mini_portile'。 Mini-Portile将存储一堆编译后的C库,这些库被用来代替系统库,因此它可以吸取一点磁盘空间 - 当你在自己的机器上运行时,这通常不是问题。 – max

+0

谢谢你们,我使用'rvm remove ruby​​ 2.1.5'删除了旧的ruby版本(原来也卸载了所有的宝石)。我的磁盘使用量从1GB下降到400MB(而在添加新的Ruby版本之前,它只有700 MB以上)。然后我跑了'gem install nokogiri'和'bundle install',都没有问题。一切正常。有趣的是,现在我的磁盘使用量已经超过了500MB,而在这之前所有的磁盘使用量都超过了700 MB。总之,磁盘空间确实是所有问题的原因。 @Doon,如果您将其添加为答案,我会接受它。 – Nick

回答

1

通过rvm删除旧版本的ruby,这将释放空间。

未来,您可能会尝试使用rvm upgrade进行升级,因为它会升级红宝石,并尝试迁移所有宝石,然后为您提供删除旧红宝石的选项。但是,如果由于配额而造成空间受限,则可能会遇到类似的问题。