I have an ruby with sinatra application, and Im trying to run the server with unicorn.
Im using the command:
service unicorn restart
service ngnix restart
and in my logs I get:
/usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'/usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- sinatra (LoadError)
from /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
this problem would be solved running unicorn with bundle exec
how can I do that?
Thanks
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.
How did you install and configure unicorn? Are you using the Ruby on Rails One-Click application? If so, unicorn is started and stopped using an init script located in
/etc/init.d/unicorn
This can be configured in/etc/default/unicorn
The default contents looks like:To use bundler, you would need to update the
DAEMON
line. It defines the command that will be run. You’ll probably want something like:You can use the command
which bundle
to see the full path of the bundle binary.For more information about the setup on the Ruby on Rails One-Click app, see this tutorial:
I solved that issue by changing and adding the ruby version that I was using (2.2.0) into the
/etc/defaul/unicorn
Hey @asb,
At first thanks for the support.
Im running the Ruby on Rails One-Click app, as you said I tried to change the
DAEMON
line on the file/etc/default/unicorn
to use the bundle exec option.Now whenever I restart/stop/start my unicorn service I got the following message:
Could not locate Gemfile
I also tried to indicate where the Gemfile location is but not succefull from now…
Do you have any other thoughts in mind?
Thank you!