bcrypt-ruby 不会与捆绑器一起安装,但与 gem install 一起安装时可以正常工作

发布于 2024-12-10 01:56:40 字数 1084 浏览 1 评论 0原文

我最近开始遇到捆绑程序的问题 - 在进行捆绑安装或 sudo 捆绑安装时,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 和捆绑器 1.0.21。其他宝石似乎通过捆绑器工作得很好。虽然这可能是显而易见的,但我已经确认 ruby​​-dev、gcc 等软件包已安装。我尝试过将 --deployment 选项与捆绑器一起使用,但没有任何不同的行为。我认为最近发生的唯一变化是我几天前进行了捆绑包更新,因此捆绑包进行了次要版本更改(1.0.10 -> 1.0.21),而 bcrypt 似乎进行了主要版本更改( 2.1.4→3.0.1)。

任何帮助表示赞赏!

I just recently began having trouble with bundler - bcrypt-ruby will not install when doing a bundle install or sudo bundle install and exits with the following error:

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.

However, gem install bcrypt-ruby -v '2.1.4' runs just fine (and in fact has already been run on this box). Running /usr/bin/ruby1.8 extconf.rb manually works just fine, and the resulting Makefile also runs with make just fine.

I'm using Ruby 1.8.7 and bundler 1.0.21 on Ubuntu 10.04.1 LTS. Other gems seem to be working fine through bundler. Though this is probably obvious, I've confirmed that the ruby-dev, gcc, etc packages are installed. I've tried using the --deployment option with bundler with no different behavior. The only thing I can think that has changed recently is I did a bundle update a couple days ago, so bundle got a minor version change (1.0.10 -> 1.0.21) and bcrypt appears to have gotten a major version change (2.1.4 -> 3.0.1).

Any help is appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

悲喜皆因你 2024-12-17 01:56:40

您安装 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

Have you upgraded to Lion since you installed Ruby 1.9.2? If so it is probably linked to the wrong gcc.

Try uninstalling and reinstalling 1.9.2, I would suggest using rvm

rvm uninstall 1.9.2

rvm install 1.9.2

If that does not work you might have to implode 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
望她远 2024-12-17 01:56:40

尝试:

sudo apt-get install build-essential

try:

sudo apt-get install build-essential
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文