2

我最近刚开始遇到 bundler 的问题 - 执行 bundle install 或 sudo bundle install 时不会安装 bcrypt-ruby 并退出并出现以下错误:

Installing bcrypt-ruby (2.1.4) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb 

Gem files will remain installed in /home/deploy/vendor/bundle/ruby/1.8/gems/bcrypt-ruby-2.1.4 for inspection.
Results logged to /home/deploy/vendor/bundle/ruby/1.8/gems/bcrypt-ruby-2.1.4/ext/mri/gem_make.out
An error occured while installing bcrypt-ruby (2.1.4), and Bundler cannot continue.
Make sure that `gem install bcrypt-ruby -v '2.1.4'` succeeds before bundling.

但是,gem install bcrypt-ruby -v '2.1.4'运行得很好(实际上已经在这个盒子上运行过)。手动运行/usr/bin/ruby1.8 extconf.rb就可以了,生成的 Makefile 也可以使用 make 运行。

我在 Ubuntu 10.04.1 LTS 上使用 Ruby 1.8.7 和 bundler 1.0.21。其他宝石似乎通过捆绑器工作正常。虽然这可能很明显,但我已经确认安装了 ruby​​-dev、gcc 等软件包。我尝试将 --deployment 选项与捆绑器一起使用,但没有不同的行为。最近我唯一能想到的变化是我几天前做了一个包更新,所以包有一个小版本更改(1.0.10 -> 1.0.21),bcrypt 似乎有一个主要版本更改(2.1 .4 -> 3.0.1)。

任何帮助表示赞赏!

4

2 回答 2

7

自从安装 Ruby 1.9.2 后,您升级到 Lion 了吗?如果是这样,它可能与错误的 gcc 相关联。

尝试卸载并重新安装 1.9.2,我建议使用rvm

rvm uninstall 1.9.2

rvm install 1.9.2

如果这不起作用,您可能不得不内爆 rvm

rvm implode

bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

source ~/.bash_profile

rvm install 1.9.2
于 2012-01-31T18:21:06.323 回答
0

尝试:

sudo apt-get install build-essential
于 2013-08-07T10:16:12.033 回答