Trouble updating to 1.8 (Bundler::GemNotFound)

I’m struggling to update from 1.7 to 1.8 via Ansible on Ubuntu 18.04.

After fixing permission issues I keep ending up at this error: Could not find racc-1.5.2 in any of the sources (Bundler::GemNotFound) (full error below)

This gem appears to be installed, but not found, and I can’t figure out why.

root@cpu0547:/var/www/ood/apps/sys/dashboard# bundle info racc
  * racc (1.5.2)
        Summary: Racc is a LALR(1) parser generator
        Homepage: http://i.loveruby.net/en/projects/racc/
        Path: /var/lib/gems/2.5.0/gems/racc-1.5.2
App 42569 output: Error: The application encountered the following error: Could not find racc-1.5.2 in any of the sources (Bundler::GemNotFound)
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/spec_set.rb:86:in `block in materialize'
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/spec_set.rb:80:in `map!'
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/spec_set.rb:80:in `materialize'
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/definition.rb:170:in `specs'
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/definition.rb:237:in `specs_for'
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/definition.rb:226:in `requested_specs'
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:101:in `block in definition_method'
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:20:in `setup'
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler.rb:149:in `setup'
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/setup.rb:20:in `block in <top (required)>'
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:136:in `with_level'
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:88:in `silence'
App 42569 output:     /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/setup.rb:20:in `<top (required)>'
App 42569 output:     /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
App 42569 output:     /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
App 42569 output:     /opt/ood/passenger/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:363:in `activate_gem'
App 42569 output:     /opt/ood/passenger/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:221:in `block in run_load_path_setup_code'
App 42569 output:     /opt/ood/passenger/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:527:in `running_bundler'
App 42569 output:     /opt/ood/passenger/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:220:in `run_load_path_setup_code'
App 42569 output:     /opt/ood/passenger/src/helper-scripts/rack-loader.rb:86:in `load_app'
App 42569 output:     /opt/ood/passenger/src/helper-scripts/rack-loader.rb:116:in `block in <module:App>'
App 42569 output:     /opt/ood/passenger/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:380:in `run_block_and_record_step_progress'
App 42569 output:     /opt/ood/passenger/src/helper-scripts/rack-loader.rb:115:in `<module:App>'
App 42569 output:     /opt/ood/passenger/src/helper-scripts/rack-loader.rb:28:in `<module:PhusionPassenger>'
App 42569 output:     /opt/ood/passenger/src/helper-scripts/rack-loader.rb:27:in `<main>'
[ E 2021-02-17 09:18:45.9645 42456/T2z age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /var/www/ood/apps/sys/dashboard: The application encountered the following error: Could not find racc-1.5.2 in any of the sources (Bundler::GemNotFound)
  Error ID: 1b16a837
  Error details saved to: /tmp/passenger-error-rqYqQA.html

[ E 2021-02-17 09:18:45.9859 42456/T8 age/Cor/Con/CheckoutSession.cpp:276 ]: [Client 1-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 1b16a837. Please see earlier logs for details about the error.
[ N 2021-02-17 09:18:48.1681 42456/T5 age/Cor/SecurityUpdateChecker.h:519 ]: Security update check: no update found (next check in 24 hours)

Generally you can solve that with a simple

bundle install --path vendor/bundle

The issue is usually with the bundler path configuration. In the first paragraph of their documentation they tell you where to find those configurations and change them manually too if needed.

If that doesn’t work then

  • Remove all your gems (go to the gems folder of your ruby, remove the specifications folder and the gems folder)
  • gem list should be more or less empty
  • gem install bundler
  • And then just try to bundle install again from scratch.

That seems to have fixed the dashboard app, thanks!

Is it expected that each app has all of these gems local to the app, and can’t use a shared location? Or does this seem like a config issue?

1 Like

Yes that’ll work, but what’s your ood_source_version set to? Is it 1.8.9? Looks like racc was just recently added in the 2.0.0 branch (master) that’s a little unstable and getting updates. What’s worse is you’re in a mix of updates where you have bundler 2.1.4 (an ood 2.0 update) but still ruby 2.5 (1.8). Since we haven’t really officially released 2.0 I haven’t gotten around to update the role for the same, so I’d say set this variable to ensure you build the right source.

To answer you’re question - no this isn’t expected. I just ran though this and it should have installed all the gems to the system location /var/lib/gems/2.7.0/gems (on ubuntu 20.04).

1 Like

Thanks Jeff, I went with the default from the ansible role which is indeed master. I’ll start over with 1.8.18 and see if it’s any better.

Installing 1.8.18 was much better, no Ruby problems. Thanks again!

1 Like