Use bundler to run rake
authorTom Hughes <tom@compton.nu>
Fri, 20 Feb 2015 16:35:09 +0000 (16:35 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 20 Feb 2015 16:35:09 +0000 (16:35 +0000)
cookbooks/web/definitions/rails_port.rb

index 205695c..a7a8c93 100644 (file)
@@ -79,7 +79,7 @@ define :rails_port, :action => [:create, :enable] do
 
   execute "#{rails_directory}/public/assets" do
     action :nothing
-    command "rake#{ruby_version} assets:precompile"
+    command "bundle#{ruby_version} exec rake#{ruby_version} assets:precompile"
     environment "RAILS_ENV" => "production"
     cwd rails_directory
     user rails_user
@@ -90,7 +90,7 @@ define :rails_port, :action => [:create, :enable] do
 
   execute "#{rails_directory}/db/migrate" do
     action :nothing
-    command "rake#{ruby_version} db:migrate"
+    command "bundle#{ruby_version} exec rake#{ruby_version} db:migrate"
     cwd rails_directory
     user rails_user
     group rails_group