capistrano

How can I use Rails 5.2 credentials in capistrano's deploy.rb file?

强颜欢笑 提交于 2020-01-02 02:24:05
问题 I've just updated my Rails app to 5.2, and configured it to use the new config/credentials.yml.enc file. When I try to deploy, I get this error: NameError: uninitialized constant Rails /Users/me/Documents/project/config/deploy.rb:27:in `<top (required)>' That's pointing to this line in my config/deploy.rb file: set :rollbar_token, Rails.application.credentials[:rollbar_token] So it appears that while capistrano is running, it doesn't have access to Rails.application.credentials . How are you

Capistrano compile assets error - assets:precompile:nondigest?

元气小坏坏 提交于 2020-01-02 01:59:53
问题 My App seems to be deploying correctly but I'm getting this error: * executing "cd /home/deploy/tomahawk/releases/20120208222225 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile" servers: ["ip_address"] [ip_address] executing command *** [err :: ip_address] /opt/ruby/bin/ruby /opt/ruby/bin/rake assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets I've tried solutions here for trying to compile assets: http://lassebunk.dk/2011/09/03/getting-your

How do i make nginx and passenger restart automatically after a deploy

那年仲夏 提交于 2020-01-01 14:55:14
问题 I currently have a rails app deployed on a virtual private server. I use Capistrano, Nginx and passenger to run my rails app on the server. For some reason I can never get the updated code to display on the site after i have done a cap deploy:update. The deploy happens fine and the code is even seen on the live server via Vim but if I navigate to the live site it won't display. My current workaround is rebooting the server, starting nginx and passenger after the server boots back up. my

How to properly diagnose a 500 error (Rails, Passenger, Nginx, Postgres)

有些话、适合烂在心里 提交于 2020-01-01 09:45:09
问题 I'm having a real tough time diagnosing a 500 error from my application running in production. I've had it working before, but after re-deploying via Capastrano I am unable to get it going. Here are the facts: The server is setup with nginx + passenger, and I'm using PostgreSQL. Static assets are working properly, as in I'm able to access them just fine in a browser. I can access the rails console via RAILS_ENV=production bundle exec rails console and perform Active Record actions (like

Deploying with capistrano does ignore group setting

倖福魔咒の 提交于 2020-01-01 09:17:29
问题 In my deploy-file I set the group to www-data: set :user, "root" set :group, "www-data" so when using cap:setup I expected capistrano to chown the folders with root:www-data But all folders and files are root:root. Any ideas where this problem could come from? Information: I'm Using system-wide-rvm. 回答1: as for my understanding you should do it manually, what setup does is to use the user to login, not to set the rights to directory. I have found no group setting for capistrano, maybe you

Passenger doesn't seem to be running (Capistrano/Rails/Apache/Ubuntu)

假如想象 提交于 2020-01-01 09:12:14
问题 Deploying a Rails app using Capistrano to an Ubuntu VM running Apache with Passenger enabled. I followed this tutorial: https://www.phusionpassenger.com/library/install/apache/install/oss/trusty/ with a few changes given that I'm on 17.04, not 14.04 LTS. passenger-config validate-install says everything looks fine with both Passenger and Apache. passenger-memory-stats shows both Passenger and Apache processes. I have sudo apache2ctl restart ed several times, with no warnings. But passenger

Unicorn/Nginx process missing, socket open

与世无争的帅哥 提交于 2020-01-01 05:35:09
问题 I am trying to deploy code using Capistrano, and it fails on deploy:start or deploy:stop because the Unicorn process is already killed. However if I try to cap deploy:start , I get a stderr claiming that Address already in use - /tmp/my_app.socket . How would this happen, and how might I get out of this mess? 回答1: Still not sure how this happens, but the following solution seems to work: lsof /tmp/my_app.socket - lists the pids kill -9 pid - (replace 'pid' with one of those listed) Then cap

Deploy Rails 5.1 / Webpacker app with Capistrano

牧云@^-^@ 提交于 2020-01-01 05:14:26
问题 I have an Ubuntu server to deploy my Rails projects. In my Ubuntu server I had RVM. Now I want to deploy new projects with Rails 5.1 and webpacker. To deploy this projects, I've installed NVM, npm and yarn in my Ubuntu server. In my Rails 5.1 / Webpacker project I have following gems for capistrano deployment: Gemfile group :development do gem 'capistrano-rails' gem 'capistrano-rvm' gem 'capistrano-passenger' gem 'capistrano-nvm', require: false gem 'capistrano-yarn' end In deploy.rb I've

Where do you put your app-config-files when deploying rails with capistrano and svn

浪尽此生 提交于 2020-01-01 03:04:30
问题 I have two config-files /app/config/database.yml and /app/config/userconfig.yml i don't want to put the database credentials and userconfig in the svn-repository, so i have database.yml.dist and userconfig.yml.dist checked in. What is the best way to get copys of the dist-files in the shared-directory when deploying the app for the first time? For later deploys i'll link to them from /app/current/config 回答1: You should place your config files in /path/to/deployed_app/shared Then in a

Invoke delayed_job capistrano tasks only on specific servers

喜你入骨 提交于 2019-12-31 22:27:34
问题 I have a dedicated server for delayed_job tasks. I want to start, stop, and restart delayed_job workers on only this server. I am using the capistrano recipes provided by delayed_job. When I only had 1 server, this was my config: before "deploy:restart", "delayed_job:stop" after "deploy:restart", "delayed_job:start" after "deploy:stop", "delayed_job:stop" after "deploy:start", "delayed_job:start" Now I want to have those hooks only apply to a separate delayed_job server ( role :delayed_job