engineyard / eycap

Engine Yard specific capistrano recipes
117 stars 63 forks source link

eycap is using old syntax for bundler #6

Closed stuartpiltch closed 14 years ago

stuartpiltch commented 14 years ago

The /lib/eycap/recipes/bundler.rb file still uses the "gem bundle" command, which breaks under bundler > 0.9. I think it needs to be changed to "bundle install" now.

Here's what happens with a deploy today (eycap 0.5.3 and bundler 0.9.11):

executing "if [ -f /.../Gemfile ]; then cd /... && gem bundle --cached; fi"
    servers: ["65.74.186.4"]
    [65.74.186.4:8184] executing command
 ** [out :: 65.74.186.4:8184] ERROR:  While executing gem ... (RuntimeError)
 ** [out :: 65.74.186.4:8184] Unknown command bundle
stuartpiltch commented 14 years ago

In case someone else runs into this before it's fixed, you can easily override the ey task by adding this to the bottom of your config/deploy.rb file:

namespace :bundler do
  desc "Automatically installed your bundled gems if a Gemfile exists"
  task :bundle_gems do
    run "if [ -f #{release_path}/Gemfile ]; then cd #{release_path} && bundle install; fi"
  end
  after "deploy:symlink_configs","bundler:bundle_gems"
end
wdperson commented 14 years ago

Hello,

Sorry for missing this. I am working on a fix for this and hope to have it resolved shortly.

Mike Riley Engine Yard

wdperson commented 14 years ago

Hello,

I have pushed this fix to gemcutter. Let us know if you see any issues with the new build or if it is working correctly for you.

thanks Mike Riley Engine Yard

stuartpiltch commented 14 years ago

Hi Mike,

I'm having problems with the new build. After upgrading to eycap-0.5.4 and removing my extra deploy.rb commands from above, I get this:

/Library/Ruby/Site/1.8/rubygems.rb:230:in `activate': can't activate eycap (= 0.5.3, runtime) for [], already activated eycap-0.5.4 for [] (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:35:in `require'
from /Library/Ruby/Gems/1.8/gems/eycap-0.5.4/lib/eycap/recipes.rb:19

After uninstalling eycap-0.5.3, I get this:

/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- eycap/recipes/ssl (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/eycap-0.5.4/lib/eycap/recipes.rb:19

Separately, I think we also need a way to pass in the "--without" option to bundle, so we can avoid installing test/dev gems in production (see http://github.com/carlhuda/bundler/issues#issue/203 for a related bundler problem with this).

Cheers,

wdperson commented 14 years ago

Hello Stuart,

Thanks for the update on this. I'll take a look at this and get back to you as soon as possible.

thanks Mike Riley Engine Yard

wdperson commented 14 years ago

Hello Stuart,

I think I have this patched correctly for the second issue you have above. Regarding the "--without" option to bundle, I am going to talk to Yehuda about this and see if he has any insight on this. If the testing goes ok on the new build, I will have it pushed to gemcutter tomorrow morning. Sorry for the issues on this. For now I have removed version 0.5.4.

Mike Riley