简体   繁体   中英

An error occurred while installing bcrypt 3.1.7 and bundler cannot continue

I'm using rubystack2.2.0. When I run bundle install for a new project that uses bcrypt, I'm getting this error:

Installing bcrypt 3.1.7 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension

and here is the verbose output

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/ws/sachilig-sjc/new/ruby/bin/ruby -r ./siteconf20150709-16222-82kbqs.rb extconf.rb
checking for ruby/util.h... yes
creating Makefile

make "DESTDIR=" clean
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in pattern match (m//) at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Argument "UUUUUUUUUUUU" isn't numeric in division (/) at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Illegal division by zero at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
BEGIN failed--compilation aborted at /ws/sachilig-sjc/new/perl/lib/5.16.3/File/Basename.pm line 52.
Compilation failed in require at /router/bin/make line 37.
BEGIN failed--compilation aborted at /router/bin/make line 37.

make "DESTDIR="
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in concatenation (.) or string at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Use of uninitialized value in pattern match (m//) at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Argument "UUUUUUUUUUUU" isn't numeric in division (/) at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
Illegal division by zero at /ws/sachilig-sjc/new/perl/lib/5.16.3/warnings.pm line 390.
BEGIN failed--compilation aborted at /ws/sachilig-sjc/new/perl/lib/5.16.3/File/Basename.pm line 52.
Compilation failed in require at /router/bin/make line 37.
BEGIN failed--compilation aborted at /router/bin/make line 37.

make failed, exit code 255

Gem files will remain installed in /ws/sachilig-sjc/new/ruby/lib/ruby/gems/2.2.0/gems/bcrypt-3.1.7 for inspection.
Results logged to /ws/sachilig-sjc/new/ruby/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/bcrypt-3.1.7/gem_make.out
An error occurred while installing bcrypt (3.1.7), and Bundler cannot continue.
Make sure that gem install bcrypt -v '3.1.7' succeeds before bundling.

I believe I had this same problem and I may have solved it using rm -rf Gemfile.lock

, then remove the version information from your Gemfile and then try to run gem install bcrypt see if that works... if so: bundle bundle update if that doesn't work then you have the wrong version of ruby -v or rails -v . In which case you may have to rbenv install Ruby then gem install Rails . I'm not sure what my exact order of events was for things like that but I kept doing things like this and eventually something gave in.

By the way your ruby is definitely not the most up to date at 2.2.0 so you probably want to go and install ruby.. https://gorails.com has some stuff.

It helped me to replace the gem 'bcrypt', '3.1.7' with gem 'bcrypt', '~> 3.1.7' in the Gemfile of my rails application.

The difference is that the bundler can load any gem that varies with the last (minor) number.

Then I run bundle install from the command line and it works like miracle.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM