The unicorn server seems to be continuing to look at rails_project, despite the fact that I’ve edited it to point towards my own project (wll-rails-project).
I have followed
I have changed the unicorn log to point to my custom app
listen "unix:/run/DigitalOceanOneClick/unicorn.sock"
worker_processes 4
user "rails"
working_directory "/home/rails/wll-rails-app"
pid "/run/DigitalOceanOneClick/unicorn.pid"
stderr_path "/var/log/unicorn/unicorn.log"
stdout_path "/var/log/unicorn/unicorn.log"
and executed
service unicorn restart
but the unicorn log seems to keep referring to the orginal rails_project:
the unicorn log is:
I, [2017-04-24T02:08:11.716339 #7687] INFO – : worker=2 spawning…
I, [2017-04-24T02:08:11.722219 #10173] INFO – : worker=2 spawned pid=10173
I, [2017-04-24T02:08:11.762538 #10173] INFO – : Refreshing Gem list
Exception Bundler::GemNotFound' at /home/rails/rails_project/vendor/bundle/gems/bundler-1.14.6/lib/bundler/spec_set.rb:87 - Could not find tzinfo-1.2.3 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 tzinfo-1.2.3 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 tzinfo-1.2.3 in any of the sources Exception Bundler::GemNotFound’ at /home/rails/wll-rails-app/config/application.rb:1 - Could not find tzinfo-1.2.3 in any of the sources
Exception Bundler::GemNotFound' at /home/rails/wll-rails-app/config/environment.rb:2 - Could not find tzinfo-1.2.3 in any of the sources Exception Bundler::GemNotFound’ at config.ru:4 - Could not find tzinfo-1.2.3 in any of the sources
E, [2017-04-24T02:08:11.863520 #10166] ERROR – : Could not find tzinfo-1.2.3 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’
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!
For me the solution was to bundle install --deployment so the unicorn server is installed in the vendor folder of the new rails project. And then you need to point the paths in the .unicorn.sh file to the correct place. In my case there where to extra folders added to the path. /ruby/2.4.0 was created inside vendor/bundle so in .unicorn.sh change to: export GEM_HOME=“/home/rails/project/vendor/bundle/ruby/2.4.0” and so on for the other paths too.
Hope it helps!
the .unicorn.sh file in wll-rails-app is
#!/bin/bash
# This file is meant to be executed via systemd.
source /usr/local/rvm/scripts/rvm
source /etc/profile.d/rvm.sh
export ruby_ver=$(rvm list default string)
export CONFIGURED=yes
export TIMEOUT=50
export APP_ROOT=/home/rails/wll-rails-app
export RAILS_ENV="production"
export GEM_HOME="/home/rails/wll-rails-app/vendor/bundle"
export GEM_PATH="/home/rails/wll-rails-app/vendor/bundle:/usr/local/rvm/gems/${ruby_ver}:/usr/local/rvm/gems/${ruby_ver}@global"
export PATH="/home/rails/wll-rails-app/vendor/bundle/bin:/usr/local/rvm/gems/${ruby_ver}/bin:${PATH}"
export GITHUB_TOKEN=1ac2d28fd8b249e0dd9f776818251f26eb34100b
# Passwords
export SECRET_KEY_BASE=94efc64f5e53d6ae0874850beac4b34a1dccc9ebc9d292a81f9e0214337a7a8776d99c954d56556b59f2ed3658a05111fd0940b5273df4fd38320a83929f7729
export APP_DATABASE_PASSWORD=320912be6635f1b3a6c356daf3ad0263
# Execute the unicorn process
/home/rails/wll-rails-app/vendor/bundle/bin/unicorn \
-c /etc/unicorn.conf -E production --debug
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.