【问题标题】:Bundler problem building native extensionsBundler 问题构建本机扩展
【发布时间】:2011-01-17 16:42:09
【问题描述】:

我正在我的 Ubuntu 机器上的暂存环境中运行捆绑安装。尝试使用本机扩展安装 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 会遇到这样的问题。我正在运行捆绑程序 1.0.7。

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

【问题讨论】:

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


    【解决方案1】:

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

    如果您在使用rvm 之后仍然遇到json gem 的问题,那么它可能会更容易调试,因为您将使用与大多数其他 Ruby 专家所做的更接近的东西。

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-05-30
        • 2019-06-20
        • 2014-10-24
        • 2011-02-21
        相关资源
        最近更新 更多