Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

removed redundant bundle exec for db:migrate task

  • Loading branch information...
1 parent c682730 commit fb260c302358aaef2974dbb45c8e02d7a0719104 @7hunderbird 7hunderbird committed
Showing with 7 additions and 4 deletions.
  1. +4 −1 History.txt
  2. +2 −2 eycap.gemspec
  3. +1 −1  lib/eycap/recipes/deploy.rb
5 History.txt
@@ -1,3 +1,6 @@
+== 0.5.19 / 2011-07-19
+ * Removed redundant bundle exec from rake db:migrate task as bundler will inject 'bundle exec rake' it since 1.0.8.
== 0.5.18 / 2011-05-24
* Added task to tail apache logs. (lightcap)
* Using --binstubs to put executables in app_root/bin. (lightcap)
@@ -37,7 +40,7 @@
* updated database clone to local task - adding ability to use mysql2 adapter.
== 0.5.7 / 2009-12-21
- * updated database tasks - new xCloud infrastructure requires staging da2tabases to use master not replica for tasks
+ * updated database tasks - new xCloud infrastructure requires staging databases to use master not replica for tasks
== 0.5.6 / 2009-6-17
* updated bundler task so it won't install test or development gems
4 eycap.gemspec
@@ -1,12 +1,12 @@ do |s| = %q{eycap}
- s.version = "0.5.18"
+ s.version = "0.5.19"
s.specification_version = 2 if s.respond_to? :specification_version=
s.required_rubygems_version =">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Engine Yard"]
- = %q{2011-05-24}
+ = %q{2011-07-19}
s.description = %q{A bunch of useful recipes to help deployment to the Engine Yard private cloud.} = %q{}
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]
2  lib/eycap/recipes/deploy.rb
@@ -54,7 +54,7 @@
else raise ArgumentError, "unknown migration target #{migrate_target.inspect}"
- run "if [ -f #{release_path}/Gemfile ] ; then cd #{directory}; bundle exec #{rake} #{framework.upcase}_ENV=#{app_env} #{migrate_env} db:migrate ; else cd #{directory}; #{rake} #{framework.upcase}_ENV=#{app_env} #{migrate_env} db:migrate ; fi"
+ run "if [ -f #{release_path}/Gemfile ] ; then cd #{directory}; #{rake} #{framework.upcase}_ENV=#{app_env} #{migrate_env} db:migrate ; else cd #{directory}; #{rake} #{framework.upcase}_ENV=#{app_env} #{migrate_env} db:migrate ; fi"
desc "Display the maintenance.html page while deploying with migrations. Then it restarts and enables the site again."

3 comments on commit fb260c3


I am running Bundler version 1.0.18 and this doesn't work for me. I think that we should add the bundle exec back in.

If you choose to leave the bundle exec out, you should at least remove the if/else statement. they are identical.


As a followup, the problem was that I needed to add the following to my Capistrano comments

require 'bundler/capistrano'
set :bundle_dir, fetch(:shared_path)+"/bundled_gems"
set :bundle_flags, "--deployment"
set :bundle_without, [:development, :test]
set :bundle_roles, :web

Before, the codebase I'm working on was accomplishing this same functionality with a custom task:

  desc "Symlink Bundler deployment directory"
  task :symlink_bundle, :roles => :app, :except => { :no_release => true } do
    run "rm -rf #{release_path}/vendor/bundle"
    run "ln -s #{shared_path}/bundled_gems #{release_path}/vendor/bundle"
    run "cd #{current_path} && bundle install --deployment"

So, I believe the real problem was not my bundler version but the fact that I didn't require 'bundler/capistrano'.

Ideally it would be great if this code was smart enough to detect the inclusion of this dependency and act accordingly. Or, at the very least you could simplify this line to:

# bundle exec added by 'bundler/capistrano'
run "cd #{directory}; #{rake} #{framework.upcase}_ENV=#{app_env} #{migrate_env} db:migrate ;"

jefflab, thanks for including this. I'll take a look at this and think about how to incorporate. The deploy.rb that we give users by default does not add the capistrano method of including bundler. Rather eycap checks for a Gemfile. We are exploring many options as we refactor eycap and strive to improve and refactor.

Please sign in to comment.
Something went wrong with that request. Please try again.