我剛剛安裝了Ubuntu 13.04服務器,並安裝了RVM 1.21.11,Ruby 1.9.3-p448和Rubygems 2.0.5。安裝帶擴展的gem總是失敗
許多寶石,如蒙戈, awesome_print,AWS-S3和JSON,安裝成功。
但是,編譯擴展的gem失敗。我試過安裝nokogiri, mongo_ext和 bson_ext。它們都以相同的方式失敗,如下所示。
任何想法如何解決這個問題?
[[email protected] ~] 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>'
[[email protected] ~]
[[email protected] ~] gem -v
2.0.5
[[email protected] ~] ruby -v
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]
[[email protected] ~] rvm -v
rvm 1.21.11 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
已經安裝* build-essential *包(用於Ubuntu)。 – nickh