I am deploying my branch on a new server using BitBucket. However, after I prepared everything, during the deployment, I am getting this error message all the time.
DEBUG [076ec2be] Command: cd /opt/webapp/holidale_dev10/releases/20160211212625 && ( export RAILS_ENV="dev10" ; /usr/local/rvm/bin/rvm default do bundle exec rake assets:precompile )
DEBUG [076ec2be] rake aborted!
DEBUG [076ec2be] RestClient::RequestTimeout: Request Timeout
DEBUG [076ec2be] /opt/webapp/holidale_dev10/shared/bundle/ruby/2.3.0/gems/rest-client-1.8.0/lib/restclient/request.rb:427:in `rescue in transmit'
This is due to the timeout of one of my gem's authentication.
Related
I'm trying to deploy an application using AWS OpsWorks with chef, I had have run the deploy in other times and had never failed but this time I got the next message in the log. I run the command bundle
exec rake assets:precompile] in localhost and everything is alright,
What can be?
[2018-03-01T18:50:54+00:00] INFO: Processing execute[cd
/srv/www/my_project/releases/20180301185045 && RAILS_ENV=production bundle
exec rake assets:precompile] action run
(/opt/aws/opsworks/releases/20160504095744_3437-
20160504095744/vendor/bundle/ruby/2.0.0/gems/chef-
11.10.4/lib/chef/provider/deploy.rb line 63)
Error executing action 'run' on resource 'execute[cd
/srv/www/my_project/releases/20180301185045 && RAILS_ENV=production bundle
exec rake assets:precompile]'
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '137'
---- Begin output of cd /srv/www/my_project/releases/20180301185045 &&
RAILS_ENV=production bundle exec rake assets:precompile ----
STDOUT:
Agreed that Opsworks will always run into out of memory state during deployment especially on instances (micro/small). SSH to the instance and make swap memory (e.g. 2GB / 4GB) will help to reduce the issue a lot.
Sometimes the instances got out of memory.
Only stop and start the instance where you are doing the deploy.
when executing: cap production deploy:initial
I get an error message:
** Execute deploy:assets:precompile
00:08 deploy:assets:precompile
/usr/local/rvm/bin/rvm default do bundle exec rake assets:precompile
rake aborted!
LoadError: cannot load such file -- single_test/tasks
/home/deploy/apps/A_W_Creamery/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:i…
It seems like, you previously have installed Single test gem and now you remove it, but you forgot to remove command:
require 'single_test/tasks'
from your Rakefile.
I cant figure how to start Delayed Jobs on a dedicated Ubuntu server.
It works fine on my localhost but when I run on my server
sudo RAILS_ENV=production bin/delayed_job restart
I get
sudo: bin/delayed_job: command not found
On top of that, if I run the "rake jobs:work RAILS_ENV=production" command Im getting the following error:
PG::FeatureNotSupported: ERROR: SELECT FOR UPDATE/SHARE is not allowed in subqueries
Apparently theres an issue with my psql version.
Is there any way I can get the script to work? Any effective Capistrano recipes available? All ive found on the web are old recipes for Rails 3 and older versions of capistrano.
Thanks in advance.
EDIT:
I have already bundled install the daemons gem and generated "delayed_job:active_record" on my local machine, then proceded to cap deploy which bundle installed and migrated in the production server.
The bin/delayed_job file exists in the server yet it fails with command not found.
And add this to config/environment.rb:
ENV['RAILS_ENV'] ||= 'production'
Then at your production server:
RAILS_ENV=production rake db:migrate
RAILS_ENV=test production generate delayed_job:active_record && RAILS_ENV=production rake db:migrate
Now after you do that:
RAILS_ENV=production script/delayed_job start
As for Capistrano error you are facing, please try to add the command like:
run "cd #{current_path}; #{sudo} RACK_ENV=production bundle exec #{current_path}/bin/delayed_job start"
You must run this on target server:
bundle exec rails generate delayed_job
I am trying to deploy my rails app to a digital ocean server using the capistrano gem, and I'm getting the error :
The deploy has failed with an error: #<SSHKit::Command::Failed: RAILS_ENV= bundle exec rake assets:precompile exit status: 256
RAILS_ENV= bundle exec rake assets:precompile stdout: Nothing written
RAILS_ENV= bundle exec rake assets:precompile stderr: rake aborted!
ActiveRecord::AdapterNotSpecified: database configuration does not specify adapter
Even though the local config/database.yml and shared/config/database.yml file on the server are both configured, and have production databases set.
In case I run the rake db:create command on the server, it does create the database successfully. So, can't really find the issue.
Using rails 4.0.2, ruby 2.1.0, capsitrano 3.1.0
Sorry - I don't have the rep to comment.
It's a bit short on detail about your deploy configuration, you probably need to share.
RAILS_ENV= bundle exec rake assets:precompile stdout: Nothing written
Would suggest to me that there is no RAILS_ENV set. I don't think there is an issue with the database .yml
Infact - this post might be relevant: Capistrano 3, Rails 4, database configuration does not specify adapter
I am running into an issue when trying to run migrations from capistrano (cap deploy:migrate).
latest => /var/www/site/releases/20110108002015
* executing "cd /var/www/site/releases/20110108002015; rake RAILS_ENV=production db:migrate"
servers: ["www.site.com"]
[www.site.com] executing command
** [out :: www.site.com] (in /var/www/site/releases/20110108002015)
** [out :: www.site.com] Could not find treetop-1.4.9 in any of the sources
** [out :: www.site.com] Try running `bundle install`.
command finished
failed: "sh -c 'cd /var/www/site/releases/20110108002015; rake RAILS_ENV=production db:migrate'" on www.site.com
The facts;
Rails 3.0.0
Ruby 1.9.2 via rvm
The treetop gem is installed, and if I ssh into the remote server and run the command that capistrano is attempting manually, it works without issue.
Anyone else run into this or a similar issue?
When you ssh onto the server and run the command, is it using the same user capistrano is deploying as? Often issues like this are due to the deploy users path not including the same folders as your path might.
Try using cap shell to run the command, then you can test it under the same conditions cap is under.