New rails 3.1 assets support broken #81

Closed
gucki opened this Issue Aug 14, 2011 · 12 comments

Comments

Projects
None yet
4 participants

gucki commented Aug 14, 2011

Refering to: #35 and https://github.com/carlhuda/bundler/blob/1-0-stable/lib/bundler/capistrano.rb

When the Gemfile has been updated the rake task to precompile the assets will fail because bundle:install has not been run yet. I suggest to change after 'deploy:update_code', 'deploy:assets:precompile' to before "deploy:symlink", "deploy:assets:precompile".

gucki commented Aug 14, 2011

There's an easy workaround for now, just add before "deploy:assets:precompile", "bundle:install" to your deploy.rb

Owner

leehambley commented Aug 14, 2011

@cgriego ping

Contributor

cgriego commented Aug 14, 2011

@gucki Can yo share your Capfile, deploy.rb (obfuscating anything sensitive), and Bundler version?

gucki commented Aug 15, 2011

@cgriego I could post my configuration files, but they are pretty much standart. bundler is at 1.0.15. Looking at the sources I mentioned you can easily see why bundle:install is called after deploy:assets:precompile.

In bundler capistrano recipe: after "deploy:finalize_update", "bundle:install"
In capistrano assets: before 'deploy:finalize_update', 'deploy:assets:symlink'

If you still need my configs, please let me know and I'll post them asap.

Contributor

cgriego commented Aug 15, 2011

@gucki I need to see them. Specifically how you're loading the deploy, deploy/assets, and bundler recipes.

gucki commented Aug 15, 2011

@cgriego: Ok, here they are :)

deploy.rb: http://pastie.org/2375072
Capfile: http://pastie.org/2375074

Contributor

cgriego commented Aug 18, 2011

I'm sorry I haven't responded back. Past couple of days got away from me, and then the issue turned out to be more subtle than I expected. Just wanted to let you know I haven't forgotten you.

gucki commented Aug 18, 2011

@cgriego Thanks for keeping me updated, very nice :)

Bundle install isn't the only issue. I have a custom task I was running after deploy:update_code to write my production database.yml files. If this doesn't go before the asset precompile, I get a failure because rake isn't loading right. There are other post-code-update things people might want to do as well that may affect how it runs. I ended up moving it to before deploy:finalize_update, but it feels wrong and brittle to have to jigger things around like that.

Would before deploy:symlink be so bad? I can't think of anything else that would depend on this update except for the running app, so it seems like a good place to make it happen without being affected by anything else.

gucki commented Sep 2, 2011

@cgriego Any news? :) What are the problems you are facing?

Contributor

cgriego commented Sep 4, 2011

Okay, there are two options here.

  1. Upgrade Bundler to 1.0.18 on the deploying machine. It includes a change to the Capistrano hook.
  2. Move the require 'bundler/capistrano' line from the deploy.rb file to the Capfile between loading the deploy and deploy/assets files.

gucki commented Sep 14, 2011

Seems to be working fine for me now using bundler 1.0.18, so I'm closing this issue. Thanks!

@gucki gucki closed this Sep 14, 2011

mattbrictson pushed a commit to mattbrictson/capistrano that referenced this issue Aug 24, 2016

Merge pull request #81 from tab/master
Fix "Fork me on GitHub" ribbon link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment