It seems Bundler 1.11.0 is having issues when you use a specific version of Ruby (we use Ruby 2.1.7). There is an open issue on github here but we’d like to still know how to use a prior version of bundler in the future.
It fails with the error:
./ci-build.rb install
Installing project: admin
--- ERROR REPORT TEMPLATE -------------------------------------------------------
- What did you do?
I ran the command `/home/ubuntu/.rvm/gems/ruby-2.1.7@global/bin/bundle install --without=development --path=/home/ubuntu/applicationnamehere/vendor/bundle --jobs=4 --retry=3`
- What did you expect to happen?
I expected Bundler to...
- What happened instead?
Instead, what actually happened was...
Error details
RuntimeError: LazySpecification has not been materialized yet (calling :required_ruby_version [])
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/lazy_specification.rb:75:in `method_missing'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/resolver.rb:132:in `for?'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/resolver.rb:275:in `block in search_for'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/resolver.rb:275:in `select'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/resolver.rb:275:in `search_for'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/resolver.rb:332:in `block in verify_gemfile_dependencies_are_found!'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/resolver.rb:330:in `each'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/resolver.rb:330:in `verify_gemfile_dependencies_are_found!'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/resolver.rb:199:in `start'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/resolver.rb:183:in `resolve'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/definition.rb:198:in `resolve'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/definition.rb:163:in `missing_specs'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/installer.rb:187:in `block in resolve_if_need'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/ui/shell.rb:80:in `silence'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/installer.rb:184:in `resolve_if_need'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/installer.rb:69:in `run'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/installer.rb:21:in `install'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/cli/install.rb:105:in `run'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/cli.rb:172:in `install'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/cli.rb:10:in `start'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/exe/bundle:19:in `block in <top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/gems/bundler-1.11.0/exe/bundle:17:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/bin/bundle:23:in `load'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/bin/bundle:23:in `<main>'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/bin/ruby_executable_hooks:15:in `eval'
/home/ubuntu/.rvm/gems/ruby-2.1.7@global/bin/ruby_executable_hooks:15:in `<main>'
Environment
Bundler 1.11.0
Rubygems 2.4.8
Ruby 2.1.7p400 (2015-08-18 revision 51632) [x86_64-linux]
GEM_HOME /home/ubuntu/applicationnamehere/vendor/bundle/ruby/2.1.0
GEM_PATH
RVM 1.26.10 (1.26.10)
Git 1.8.5.6
Bundler settings
retry
Set for your local app (/home/ubuntu/applicationnamehere/admin/.bundle/config): 3
path
Set for your local app (/home/ubuntu/applicationnamehere/admin/.bundle/config): "/home/ubuntu/applicationnamehere/vendor/bundle"
jobs
Set for your local app (/home/ubuntu/applicationnamehere/admin/.bundle/config): 4
without
Set for your local app (/home/ubuntu/applicationnamehere/admin/.bundle/config): "development"
disable_shared_gems
Set for your local app (/home/ubuntu/applicationnamehere/admin/.bundle/config): "1"
--- TEMPLATE END ----------------------------------------------------------------
Unfortunately, an unexpected error occurred, and Bundler cannot continue.
First, try this link to see if there are any existing issue reports for this error:
https://github.com/bundler/bundler/search?q=LazySpecification+has+not+been+materialized+yet+%28calling+%3Arequired_ruby_version+%5B%5D%29&type=Issues
If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
https://github.com/bundler/bundler/issues/new
./ci-build.rb:32:in `block in install': Cannot finish gem installation (RuntimeError)
from ./ci-build.rb:122:in `chdir'
from ./ci-build.rb:122:in `chdir'
from ./ci-build.rb:31:in `install'
from ./ci-build.rb:131:in `block in install'
from ./ci-build.rb:129:in `each'
from ./ci-build.rb:129:in `install'
from ./ci-build.rb:208:in `run_cli'
./ci-build.rb install returned exit code 1
from ./ci-build.rb:221:in `<main>' Action failed: ./ci-build.rb install
After trying to add the following to our circleci.yml
file under pre-dependencies:
gem uninstall bundler
gem install bundler -v 1.10.6
This error occurred on CircleCi.com
gem uninstall bundler
ERROR: While executing gem ... (Gem::InstallError)
bundler is not installed in GEM_HOME, try:
gem uninstall bundler returned exit code 1
gem uninstall -i /home/ubuntu/.rvm/gems/ruby-2.1.7@global bundler Action failed: gem uninstall bundler
Removing the uninstall and just doing an install of bundler v1.10.6 doesn’t help because 1.11.0 is still being used.
Any help is appreciated.