Bundler问题构建本机扩展

时间:2011-01-17 16:42:10

标签: ruby-on-rails json ruby-on-rails-3 gem bundler

我正在我的Ubuntu计算机上的暂存环境中运行bundle install。它一直在尝试使用本机扩展安装json 1.4.6失败。

 Using bundler (1.0.7) 
Installing thor (0.14.6) 
Installing railties (3.0.3) 
Installing rails (3.0.3) 
Installing geokit-rails3 (0.1.2) 
Installing json (1.4.6) with native extensions /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/usr/bin/ruby1.8 extconf.rb 

Gem files will remain installed in /u/apps/uat.nicetripper.com/shared/bundle/ruby/1.8/gems/json-1.4.6 for inspection.
Results logged to /u/apps/example.com/shared/bundle/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/gem_make.out
 from /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:446:in `each'
 from /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
 from /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:198:in `install'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/source.rb:95:in `install'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:55:in `run'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `send'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/bin/bundle:13
 from /usr/bin/bundle:19:in `load'
 from /usr/bin/bundle:19

我已经在这台机器上安装了json gem(1.4.6)gem,它安装了原生扩展名。

root@ve:/code# gem install json
Building native extensions.  This could take a while...
Successfully installed json-1.4.6
1 gem installed

我不明白为什么bundler会遇到这样的问题。我正在运行bundler 1.0.7。

请帮助,因为必须将json 1.4.6作为另一个重要宝石的依赖项包含在内。

2 个答案:

答案 0 :(得分:2)

Ubuntu很可能提供了Ruby或RubyGems。我真的建议您使用RVM安装Ruby,如本文所述:Ubuntu, Ruby, RVM, Rails, and You

如果使用json后仍然遇到rvm gem的问题,那么调试起来可能要容易得多,因为你会使用更接近大多数其他Rubyist的东西。< / p>

答案 1 :(得分:0)

我在Ubuntu 12.04中遇到了与Simon ruby​​ 1.8相同的问题。我正在尝试安装Redmine和Bundler(sudo bundle install)在构建json gem时保持失败并出现相同的错误。 sudo gem install json工作得很好,所以我做了,然后用Bundler安装了应用程序的其余部分。希望这有助于某人。