How to seed the production database using the Capistrano gem?

If you are using bundler, then the capistrano task should be: namespace :deploy do desc “reload the database with seed data” task :seed do run “cd #{current_path}; bundle exec rake db:seed RAILS_ENV=#{rails_env}” end end and it might be placed in a separate file, such as lib/deploy/seed.rb and included in your deploy.rb file using following command: … Read more

How do I target a specific commit SHA with capistrano deploy

For Capistrano 2.9 until 3.0: cap -S revision=80655da8d80aaaf92ce5357e7828dc09adb00993 deploy For older versions of Capistrano, you can deploy a particular git commit/tree/branch/tag by doing this: cap -s branch=80655da8d80aaaf92ce5357e7828dc09adb00993 deploy In some cases there may be a need of specifying the Environment as an argument as well. production is just an example. cap production -S revision=80655da8d80aaaf92ce5357e7828dc09adb00993 deploy

rails active admin deployment : couldn’t find file ‘jquery-ui’

The “jquery-rails” gem recently removed jQuery UI. https://github.com/rails/jquery-rails/commit/2fdcdb2633cbc6426d412c050200fc31d14b9a3b They recommend using the jquery-ui-rails gem. There is an active pull request (as of this writing) to add that gem as a dependency. However, the developers of ActiveAdmin have stated that they are “locking it down until we officially drop support for Rails 3.0”. The version they … Read more

Deploying a Rails App to Multiple Servers using Capistrano – Best Practices

It should all go in one file. Here’s an example: set :application, “my-app” set :repository, “git@git.my-git-host.com:my-app.git” set :keep_releases, 5 set :deploy_via, :remote_cache set :git_enable_submodules, true set :scm, :git set :user, ‘your-user-here’ set :deploy_to, “/var/www/staging.mydomain.com” set :branch, ‘staging’ set :rails_env, ‘staging’ role :web, “machine1.mydomain.com”, “machine2.mydomain.com”, “machine3.mydomain.com” role :app, “machine1.mydomain.com”, “machine2.mydomain.com”, “machine3.mydomain.com” role :db, “db.mydomain.com” # … … Read more

tech