I'm running bundle install on my staging environment on my Ubuntu machine. It keeps failing trying to install json 1.4.6 with the native extensions.
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
I already have the json gem (1.4.6) gem installed on this machine and it installed with native extensions fine.
root@ve:/code# gem install json
Building native extensions. T开发者_运维知识库his could take a while...
Successfully installed json-1.4.6
1 gem installed
I don't understand why bundler is having such a problem with this. I'm running bundler 1.0.7.
Please help because json 1.4.6 has to be included as a dependency for another vital gem.
It's very possible that the Ubuntu provided Ruby or RubyGems is broken. I really recommend you install Ruby using RVM, as described in this post: Ubuntu, Ruby, RVM, Rails, and You.
If you still have trouble with the json
gem even after using rvm
, it'll likely be much easier to debug as you'll be using something closer to what most other Rubyists do.
I had the same issue as Simon in Ubuntu 12.04 with stock ruby 1.8. I was trying to install Redmine and Bundler (sudo bundle install
) kept failed withthe same error when building the json gem. sudo gem install json
worked just fine, so I did that and then installed the rest of the app's requirements with Bundler. Hope this helps someone.
精彩评论