0

Ubuntu 13.04 サーバーをセットアップし、RVM 1.21.11、Ruby 1.9.3-p448、および Rubygems 2.0.5 をインストールしました。

mongoawesome_printaws-s3jsonなどの多くの gem が正常にインストールされました。

ただし、拡張機能をコンパイルする gem は失敗します。nokogirimongo_ext、およびbson_extをインストールしようとしました。以下に示すように、それらはすべて同じように失敗します。

これを修正する方法はありますか?

[nick@mongo01 ~] gem install mongo_ext -u -V --backtrace
HEAD http://rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
HEAD http://production.s3.rubygems.org/latest_specs.4.8.gz
304 Not Modified
Installing gem mongo_ext-0.19.3
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/Rakefile
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/mongo-extensions.gemspec
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/extconf.rb
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/buffer.c
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/cbson.c
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/encoding_helpers.c
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/buffer.h
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/encoding_helpers.h
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/version.h
Building native extensions.  This could take a while...
/usr/local/rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
checking for asprintf()... yes
checking for ruby/st.h... yes
checking for ruby/regex.h... yes
checking for ruby/encoding.h... yes
creating Makefile
make "DESTDIR="
compiling encoding_helpers.c
compiling buffer.c
compiling cbson.c
cbson.c: In function 'write_utf8':
cbson.c:80:36: warning: pointer targets in passing argument 1 of 'check_string' differ in signedness [-Wpointer-sign]
In file included from cbson.c:46:0:
encoding_helpers.h:26:10: note: expected 'const unsigned char *' but argument is of type 'char *'
cbson.c: In function 'objectid_generate':
cbson.c:858:5: warning: implicit declaration of function 'htonl' [-Wimplicit-function-declaration]
cbson.c:867:5: warning: implicit declaration of function 'htons' [-Wimplicit-function-declaration]
cbson.c: In function 'write_element':
cbson.c:264:17: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]
linking shared-object mongo_ext/cbson.so
make "DESTDIR=" install
/usr/bin/install -c -m 0755 cbson.so /usr/local/rvm/gems/ruby-1.9.3-p448/gems/mongo_ext-0.19.3/ext/cbson/.gem.20130718-9545-1ue92ws/mongo_ext
installing default cbson libraries
ERROR:  While executing gem ... (NoMethodError)
    undefined method `join' for nil:NilClass
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:685:in `rescue in block in build_extensions'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:675:in `block in build_extensions'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:653:in `each'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:653:in `build_extensions'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:218:in `install'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:371:in `block in install'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:331:in `each'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:331:in `each_with_index'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:331:in `install'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:166:in `block in execute'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:158:in `each'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:158:in `execute'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:305:in `invoke_with_build_args'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:170:in `process_args'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:130:in `run'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:60:in `run'
        /usr/local/rvm/rubies/ruby-1.9.3-p448/bin/gem:21:in `<main>'
[nick@mongo01 ~]
[nick@mongo01 ~] gem -v
2.0.5
[nick@mongo01 ~] ruby -v
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]
[nick@mongo01 ~] rvm -v

rvm 1.21.11 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
4

2 に答える 2

0

これは、RubyGems のバグが原因でした。8d1751c6で修正されました。

RubyGems v2.0.6 がリリースされるまでは、回避策として8d1751c6を手動で適用してください。

于 2013-07-19T20:53:24.530 に答える
0

これは多くの場合、システムでネイティブ拡張機能をコンパイルする必要があり、適切な開発ツールがインストールされていないことが原因です。あなたはこれをしましたか?

 yum groupinstall 'Development Tools'

おそらく、これらのツールのいずれかが間違ったバージョンであるか、またはホースで接続されていませんか?

于 2013-07-19T02:20:39.040 に答える