bcrypt-ruby不会与bundler安装,但可以在安装gem时正常工作 [英] bcrypt-ruby won't install with bundler but works fine with gem install

查看:135
本文介绍了bcrypt-ruby不会与bundler安装,但可以在安装gem时正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始遇到捆绑软件问题 - bcrypt-ruby在进行捆绑软件安装或sudo捆绑软件安装时不会安装,并退出并出现以下错误:

<$ p $使用本机扩展安装bcrypt-ruby(2.1.4)
Gem :: Installer :: ExtensionBuildError:错误:无法构建gem本机扩展。
/usr/bin/ruby1.8 extconf.rb

Gem文件将保留安装在/home/deploy/vendor/bundle/ruby/1.8/gems/bcrypt-ruby-2.1中。 4进行检查。
结果记录到/home/deploy/vendor/bundle/ruby/1.8/gems/bcrypt-ruby-2.1.4/ext/mri/gem_make.out
安装bcrypt-ruby时发生错误( 2.1.4)和Bundler无法继续。
确保在捆绑之前`gem install bcrypt-ruby -v'2.1.4'`成功。

然而, gem install bcrypt-ruby -v'2.1.4'运行得很好(事实上它已经在这个盒子上运行过了)。运行 /usr/bin/ruby1.8 extconf.rb 可以很好地工作,并且生成的Makefile也可以正常运行。

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



任何帮助表示感谢!

解决方案

既然你安装了Ruby 1.9.2?如果是这样,它可能与错误的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安装1.9.2


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!

解决方案

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

这篇关于bcrypt-ruby不会与bundler安装,但可以在安装gem时正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆