Issue "An error occurred while installing bcrypt" during bundle install

Hi All,

Yesterday all my builds started failed on bundle install, but I hadn’t added any new gems before.

Could anyone please help me with the issue?

Log:

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

current directory:
/home/ubuntu/lenders_tie/vendor/bundle/ruby/2.3.0/gems/bcrypt-3.1.10/ext/mri
/opt/circleci/ruby/ruby-2.3.1/bin/ruby -r ./siteconf20170408-16864-wmqjid.rb
extconf.rb
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/stub_specification.rb:113:in
`initialize': No such file or directory @ rb_sysopen -
/home/ubuntu/lenders_tie/vendor/bundle/ruby/2.3.0/specifications/byebug-8.2.2.gemspec
(Errno::ENOENT)
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/stub_specification.rb:113:in
`open'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/stub_specification.rb:113:in
`data'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/stub_specification.rb:204:in
`valid?'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:749:in
`select'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:749:in
`gemspec_stubs_in'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:774:in
`block in map_stubs'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:771:in
`each'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:771:in
`flat_map'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:771:in
`map_stubs'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:763:in
`installed_stubs'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:831:in
`stubs'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:1036:in
`find_by_path'
from /opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems.rb:189:in
`try_activate'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:125:in
`rescue in require'
from
/opt/circleci/ruby/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in
`require'
	from <internal:gem_prelude>:6:in `<internal:gem_prelude>'

extconf failed, exit code 1

Gem files will remain installed in
/home/ubuntu/lenders_tie/vendor/bundle/ruby/2.3.0/gems/bcrypt-3.1.10 for
inspection.
Results logged to
/home/ubuntu/lenders_tie/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/bcrypt-3.1.10/gem_make.out

An error occurred while installing bcrypt (3.1.10), and Bundler cannot
continue.
Make sure that `gem install bcrypt -v '3.1.10'` succeeds before bundling.

bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3  returned exit code 5

Action failed: bundle install
1 Like

I’m in the same situation. It seems to be only for gems that have native code.

Any change in the default infrastructure that could be causing this ?

Thanks

I’ve fixed the issue with adding following lines in circle.yml

dependencies:
  pre:
    - gem update --system
    - gem install bundler
  override:
    - bundle check || bundle install --system --jobs=4 --retry=3 --without development

Same problem here. There clearly is an issue with Circle.
We are clearing the cache on every build now…

@ekondr, @bilby91, @doodloo, and anyone else who sees this:

Could you please open a ticket by emailing support@circleci.com with a link to the affected build?

We’ve been able to solve a number of these issues by manually clearing out each projects dependency cache, which seems to have been corrupted by the recent image update:

Best, Zak