Question

Using Ruby on Rails 5.0.1 on Ubuntu 16.04 One Click Install. Builder cannot be found but is being used?

Followed the tutorial to the letter but I’m getting “Exception Bundler::GemNotFound” in unicorn log saying builder-3.2.3 cannot be found in any sources, but when I run bundle it says that it IS using builder-3.2.3. And a 504 Gateway Timeout. Even weirder is that the log says unicorn is loading stuff from the other rails app too and I have no idea why.

This is my unicorn log:

/home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:283:in `join'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/bin/unicorn:126:in `<top (required)>'
/home/rails/rails_project/vendor/bundle/bin/unicorn:22:in `load'
/home/rails/rails_project/vendor/bundle/bin/unicorn:22:in `<main>'
/home/rails/rails_project/vendor/bundle/bin/ruby_executable_hooks:15:in `eval'
/home/rails/rails_project/vendor/bundle/bin/ruby_executable_hooks:15:in `<main>'
E, [2017-02-01T20:26:09.676442 #26470] ERROR -- : reaped #<Process::Status: pid 29328 exit 1> worker=2
I, [2017-02-01T20:26:09.676639 #26470]  INFO -- : worker=2 spawning...
I, [2017-02-01T20:26:09.683412 #29340]  INFO -- : worker=2 spawned pid=29340
I, [2017-02-01T20:26:09.714801 #29340]  INFO -- : Refreshing Gem list
Exception `Bundler::GemNotFound' at /usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/spec_set.rb:87 - Could not find builder-3.2.3 in any of the sources
Exception `Bundler::GemNotFound' at /usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:180 - Could not find builder-3.2.3 in any of the sources
Exception `Bundler::GemNotFound' at /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55 - Could not find builder-3.2.3 in any of the sources
Exception `Bundler::GemNotFound' at /home/rails/studios/config/application.rb:1 - Could not find builder-3.2.3 in any of the sources
Exception `Bundler::GemNotFound' at /home/rails/studios/config/environment.rb:2 - Could not find builder-3.2.3 in any of the sources
Exception `Bundler::GemNotFound' at config.ru:4 - Could not find builder-3.2.3 in any of the sources
Exception `Bundler::GemNotFound' at /home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/lib/unicorn.rb:56 - Could not find builder-3.2.3 in any of the sources
E, [2017-02-01T20:26:09.922847 #29331] ERROR -- : Could not find builder-3.2.3 in any of the sources (Bundler::GemNotFound)
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/spec_set.rb:87:in `block in materialize'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/spec_set.rb:80:in `map!'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/spec_set.rb:80:in `materialize'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:176:in `specs'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:235:in `specs_for'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:224:in `requested_specs'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/runtime.rb:118:in `block in definition_method'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/runtime.rb:19:in `setup'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler.rb:100:in `setup'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/setup.rb:20:in `<top (required)>'
/usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/rails/studios/config/boot.rb:3:in `<top (required)>'
/home/rails/studios/config/application.rb:1:in `require_relative'
/home/rails/studios/config/application.rb:1:in `<top (required)>'
/home/rails/studios/config/environment.rb:2:in `require_relative'
/home/rails/studios/config/environment.rb:2:in `<top (required)>'
config.ru:4:in `require_relative'
config.ru:4:in `block in <main>'
/usr/local/rvm/gems/ruby-2.3.3/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
/usr/local/rvm/gems/ruby-2.3.3/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/lib/unicorn.rb:56:in `eval'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/lib/unicorn.rb:56:in `block in builder'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:752:in `build_app!'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:617:in `init_worker_process'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:639:in `worker_loop'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:508:in `spawn_missing_workers'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:519:in `maintain_worker_count'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:283:in `join'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/bin/unicorn:126:in `<top (required)>'
/home/rails/rails_project/vendor/bundle/bin/unicorn:22:in `load'
/home/rails/rails_project/vendor/bundle/bin/unicorn:22:in `<main>'
/home/rails/rails_project/vendor/bundle/bin/ruby_executable_hooks:15:in `eval'
/home/rails/rails_project/vendor/bundle/bin/ruby_executable_hooks:15:in `<main>'
E, [2017-02-01T20:26:09.925106 #26470] ERROR -- : reaped #<Process::Status: pid 29331 exit 1> worker=3
I, [2017-02-01T20:26:09.925375 #26470]  INFO -- : worker=3 spawning...
Exception `Bundler::GemNotFound' at /usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/spec_set.rb:87 - Could not find builder-3.2.3 in any of the sources
Exception `Bundler::GemNotFound' at /usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:180 - Could not find builder-3.2.3 in any of the sources
I, [2017-02-01T20:26:09.928420 #29344]  INFO -- : worker=3 spawned pid=29344
Exception `Bundler::GemNotFound' at /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55 - Could not find builder-3.2.3 in any of the sources
Exception `Bundler::GemNotFound' at /home/rails/studios/config/application.rb:1 - Could not find builder-3.2.3 in any of the sources
Exception `Bundler::GemNotFound' at /home/rails/studios/config/environment.rb:2 - Could not find builder-3.2.3 in any of the sources
Exception `Bundler::GemNotFound' at config.ru:4 - Could not find builder-3.2.3 in any of the sources
Exception `Bundler::GemNotFound' at /home/rails/rails_project/vendor/bundle/gems/unicorn-5.2.0/lib/unicorn.rb:56 - Could not find builder-3.2.3 in any of the sources
E, [2017-02-01T20:26:09.934700 #29334] ERROR -- : Could not find builder-3.2.3 in any of the sources (Bundler::GemNotFound)
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/spec_set.rb:87:in `block in materialize'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/spec_set.rb:80:in `map!'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/spec_set.rb:80:in `materialize'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:176:in `specs'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:235:in `specs_for'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:224:in `requested_specs'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/runtime.rb:118:in `block in definition_method'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/runtime.rb:19:in `setup'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler.rb:100:in `setup'
/usr/local/rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/setup.rb:20:in `<top (required)>'
/usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/rails/studios/config/boot.rb:3:in `<top (required)>'
/home/rails/studios/config/application.rb:1:in `require_relative'
/home/rails/studios/config/application.rb:1:in `<top (required)>'
/home/rails/studios/config/environment.rb:2:in `require_relative'
/home/rails/studios/config/environment.rb:2:in `<top (required)>'
config.ru:4:in `require_relative'
config.ru:4:in `block in <main>'
/usr/local/rvm/gems/ruby-2.3.3/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
/usr/local/rvm/gems/ruby-2.3.3/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I don’t know the complete answer, but check http://bundler.io/v1.2/bundle_install.html and look for a line like export GEM_HOME="/home/rails/rails_project/vendor/bundle" in your shell profile (e.g. .bashrc or .bash_profile). Also see what the command gem env home prints.

I have a similar problem to yours, I think. I expected the output of gem env home to include something like /home/rails/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0, but instead it only prints /home/rails/rails_project/vendor/bundle.