I am a member of a foodcoop in GieÃen (Germany) and we would like to use foodsoft
After I set up the server for rails, I cloned the code from Git and adjusted the deploy.rb and the other stuff.
The ``bundle exec cap staging deploy:check -command gives the error-message:
Don’t know how to build task ‘resque:restart’ (see --tasks)
config/deploy.rb:42:in block in <top (required)>' config/deploy.rb:32:in <top (required)>’
/home/deploy/.rbenv/versions/2.2.3/bin/cap:23:in load' /home/deploy/.rbenv/versions/2.2.3/bin/cap:23:in ’
Tasks: TOP => staging
(See full trace by running task with --trace)
I tried to require ‘resque’ in the capfile, but this didn’t work.
Does anyone know how to fix it?
Thank you very much! That worked! The last line of the created Capfile was
Dir.glob(‘lib/capistrano/tasks/*.rake’).each { |r| import r }
Now, there is the next problem Thank you again for your help
I didn’t get how to adjust the production.rb and staging.rb
Is this all I need?
role :web, %w{deploy@biomio-giessen.de :3000}
INFO [fbbdb1a8] Running /usr/bin/env mkdir -p /tmp/foodsoft/ as deploy@example.com
Net::SSH::ConnectionTimeout: Net::SSH::ConnectionTimeout
Did you configure everything in config/deploy.rb and config/deploy/*
correctly? It’s a bit odd that example.com appears here.
Errno::ETIMEDOUT: Connection timed out - connect(2) for
[2a01:238:20a:202:1070::]:22
I’m not sure where this ip-address comes from.
Yes, I forgot to adjust the staging.rb, but there is still the same error…
What do I need to adjust exactly in production.rb and staging.rb?
I just added a # before each line and so there is just this
role :web, %w{deploy@biomio-giessen.de :3000}
over in each file. I think thats not everything
Rails doesn’t work with an index.html. Since you’re mentioning Unicorn, I suppose you’d like to run the Rails app with that and have Nginx act as a reverse proxy. There are many tutorials on the internet about this.
Most of my production deployments are using Passenger, where you configure a specific directory to be a Rack app. It then runs config.ru in a Ruby environment, without the need to setup a separate server.
Both will work, when setup correctly.
Ok, thank you! After wasting some ours on Unicorn, I tried to use passenger…
I adjusted Nginx for phusion passenger and they are working now, but the app doesn’t work…
When I stop Nginx and try to execute passenger, passenger is freezing…
me@h2540559:~/foodsoft$ exec passenger start --user deploy --environment production
=============== Phusion Passenger Standalone web server started ===============
PID file: /home/deploy/foodsoft/tmp/pids/passenger.3000.pid
Log file: /home/deploy/foodsoft/log/passenger.3000.log
Environment: production
Accessible via: http://0.0.0.0:3000/
Easiest would be to run passenger from within nginx. With passenger
standalone it should also work - are you sure it’s freezing, or merely
waiting for connections?
Yes I run passenger from within nginx, but there is just no output and no error…
I tested my phusion-passenger/nginx configuration on the rails testapp and everything worked fine…
The log from passenger is:
[ 2016-03-02 22:39:23.7420 27086/7fa0b89a9700 age/Cor/CoreMain.cpp:532 ]: Signal received. Gracefully shutting down… (send signal 2 more time(s) to force shutdown)
[ 2016-03-02 22:39:23.7421 27086/7fa0bf37c7c0 age/Cor/CoreMain.cpp:901 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected…
[ 2016-03-02 22:39:23.7421 27086/7fa0bf37c7c0 age/Cor/CoreMain.cpp:819 ]: Checking whether to disconnect long-running connections for process 27143, application /home/deploy/foodsoft/public (production)
[ 2016-03-02 22:39:23.7423 27086/7fa0b7fa8700 Ser/Server.h:817 ]: [ServerThr.2] Freed 128 spare client objects
[ 2016-03-02 22:39:23.7424 27086/7fa0b7fa8700 Ser/Server.h:464 ]: [ServerThr.2] Shutdown finished
[ 2016-03-02 22:39:23.7425 27086/7fa0b89a9700 Ser/Server.h:817 ]: [ServerThr.1] Freed 128 spare client objects
[ 2016-03-02 22:39:23.7425 27086/7fa0b89a9700 Ser/Server.h:464 ]: [ServerThr.1] Shutdown finished
[ 2016-03-02 22:39:23.7426 27086/7fa0b7526700 Ser/Server.h:817 ]: [ApiServer] Freed 0 spare client objects
[ 2016-03-02 22:39:23.7426 27086/7fa0b7526700 Ser/Server.h:464 ]: [ApiServer] Shutdown finished
[ 2016-03-02 22:39:23.7426 27086/7fa0bf37c7c0 age/Cor/CoreMain.cpp:819 ]: Checking whether to disconnect long-running connections for process 27143, application /home/deploy/foodsoft/public (production)
[ 2016-03-02 22:39:23.7538 27091/7f7d9af9a700 age/Ust/UstRouterMain.cpp:422 ]: Signal received. Gracefully shutting down… (send signal 2 more time(s) to force shutdown)
[ 2016-03-02 22:39:23.7539 27091/7f7da17a87c0 age/Ust/UstRouterMain.cpp:492 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected…
[ 2016-03-02 22:39:23.7539 27091/7f7d9a599700 Ser/Server.h:817 ]: [UstRouterApiServer] Freed 0 spare client objects
[ 2016-03-02 22:39:23.7539 27091/7f7d9a599700 Ser/Server.h:464 ]: [UstRouterApiServer] Shutdown finished
[ 2016-03-02 22:39:23.7542 27091/7f7d9af9a700 Ser/Server.h:464 ]: [UstRouter] Shutdown finished
[ 2016-03-02 22:39:23.7543 27091/7f7da17a87c0 age/Ust/UstRouterMain.cpp:523 ]: Passenger UstRouter shutdown finished
[ 2016-03-02 22:39:24.3609 27086/7fa0bf37c7c0 age/Cor/CoreMain.cpp:967 ]: Passenger core shutdown finished
on what system are you running your deployment?
rvm or rbenv and which ruby version are you using? I tried reset the server and deploy it again with rvm but there is still no progress…
I’ve never had much problems with RVM, Ruby or Apache versions. Having
used different versions of Passenger, mostly I didn’t find any problem.
Hope this helps a bit.
Something that may be a problem is permissions: what user are your Ruby
processes running as, and as what user did you deploy Foodsoft? The
easiest is to run as the deployment user (though a little bit less
secure). Passenger has options to configure the user.