I’m using the one-click rails droplet and deploying with Capistrano. So far everything seems to work after making small adjustments on the project directory for nginx and unicorn config files, then I ran bundle install --deployment --without=development,test --path=vendor/bundle but requests to the droplet return a bad gateway error, and
when I run sudo tail -f /var/log/unicorn/unicorn.log I see the following happening for each of its workers upon trying to start (error log below).
Thanks in advance and pĺease let me know if more info is needed.
I, [2018-06-20T03:29:07.903622 #7409] INFO -- : worker=1 spawning...
Exception `Bundler::GemNotFound' at /home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler/spec_set.rb:87 - Could not find rake-12.3.1 in any of the sources
Exception `Bundler::GemNotFound' at /home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler/definition.rb:180 - Could not find rake-12.3.1 in any of the sources
Exception `Bundler::GemNotFound' at /usr/local/rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55 - Could not find rake-12.3.1 in any of the sources
Exception `Bundler::GemNotFound' at /home/rails/skyclub-web/releases/20180620015335/config/application.rb:1 - Could not find rake-12.3.1 in any of the sources
I, [2018-06-20T03:29:07.906179 #19761] INFO -- : worker=1 spawned pid=19761
Exception `Bundler::GemNotFound' at /home/rails/skyclub-web/releases/20180620015335/config/environment.rb:2 - Could not find rake-12.3.1 in any of the sources
Exception `Bundler::GemNotFound' at config.ru:4 - Could not find rake-12.3.1 in any of the sources
E, [2018-06-20T03:29:07.906525 #19751] ERROR -- : Could not find rake-12.3.1 in any of the sources (Bundler::GemNotFound)
/home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler/spec_set.rb:87:in `block in materialize'
/home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler/spec_set.rb:80:in `map!'
/home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler/spec_set.rb:80:in `materialize'
/home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler/definition.rb:176:in `specs'
/home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler/definition.rb:235:in `specs_for'
/home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler/definition.rb:224:in `requested_specs'
/home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler/runtime.rb:118:in `block in definition_method'
/home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler/runtime.rb:19:in `setup'
/home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler.rb:100:in `setup'
/home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler/setup.rb:20:in `<top (required)>'
/usr/local/rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/rails/skyclub-web/releases/20180620015335/config/boot.rb:3:in `<top (required)>'
/home/rails/skyclub-web/releases/20180620015335/config/application.rb:1:in `require_relative'
/home/rails/skyclub-web/releases/20180620015335/config/application.rb:1:in `<top (required)>'
/home/rails/skyclub-web/releases/20180620015335/config/environment.rb:2:in `require_relative'
/home/rails/skyclub-web/releases/20180620015335/config/environment.rb:2:in `<top (required)>'
config.ru:4:in `require_relative'
config.ru:4:in `block in <main>'
/home/rails/rails_project/vendor/bundle/gems/rack-2.0.5/lib/rack/builder.rb:55:in `instance_eval'
/home/rails/rails_project/vendor/bundle/gems/rack-2.0.5/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.3.0/lib/unicorn.rb:56:in `eval'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.3.0/lib/unicorn.rb:56:in `block in builder'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:796:in `build_app!'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:661:in `init_worker_process'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:683:in `worker_loop'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:549:in `spawn_missing_workers'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:563:in `maintain_worker_count'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:293:in `join'
/home/rails/rails_project/vendor/bundle/gems/unicorn-5.3.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>'
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
Such issues are hard to troubleshoot from a remote position as this however the are some typical stuff you can try.
The error logs indicate that Bundler is unable to find the ‘rake’ gem which is required for your application to work. This can happen due to a number of reasons such as incorrect paths, permissions, or missing dependencies.
Verify that Rake is installed: You can do this by running the command gem list in your terminal. This will give you a list of all the installed gems along with their versions.
Install Rake: If Rake is not installed, you can install it by running gem install rake -v 12.3.1. This will install the specific version of Rake that your application requires.
Check the Ruby version: The Ruby version used by your application should match the one specified in your Gemfile. You can check your Ruby version by running ruby -v in your terminal.
Bundle Install: Run bundle install again. If the gems were not installed properly the first time, running bundle install again might solve the problem.
Check Gemfile.lock: Your Gemfile.lock file should contain an entry for the ‘rake’ gem. If it doesn’t, it means that ‘rake’ is not being tracked as a dependency for your project. In this case, you should add gem 'rake', '12.3.1' to your Gemfile and run bundle install again.
Check environment: If you’re deploying the application to a different environment (e.g. from development to production), you’ll need to ensure that all required gems are installed in the new environment. If you used the --without flag in your bundle install command (e.g. --without development test), you may have inadvertently excluded some required gems. Try running bundle install without the --without flag.
Capistrano Deployment: If you’re deploying with Capistrano, make sure that Capistrano is correctly configured to install your bundle. The deploy.rb file in your config/deploy directory should include require 'capistrano/bundler', which will ensure that Capistrano runs bundle install during the deployment process.
Hopefully, one of these steps will help you identify the issue. If not, details about the setup would be needed, in case anyone stumbles upon this.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.