简体   繁体   中英

How do I fix a bad Capistrano deployment?

Made a large update last night and my site is currently down. I used cap deploy:rollback with no luck. The error logs aren't telling me much. The last error I saw when trying to deploy was:

 ** [out :: website.com] You are trying to install in deployment mode after changing
 ** [out :: website.com] your Gemfile. Run `bundle install` elsewhere and add the
 ** [out :: website.com] updated Gemfile.lock to version control.
 ** [out :: website.com] 
 ** [out :: website.com] You have deleted from the Gemfile:
 ** [out :: website.com] * asset_sync
    command finished in 934ms

My cap tail just says the following with no errors:

Migrating to AddSessionsTable (20120722094547)
Migrating to AddSlugToUserProjects (20120723204816)
Migrating to AddSlugIndexToUserProjects (20120723205558)
Migrating to CreateFriendlyIdSlugs (20120723210904)
Migrating to AddNameToUsers (20120723221700)
Migrating to AddSlugToUsers (20120723222456)
Migrating to CreateComments (20120724203252)

Any help?

Run bundle install on your development server, then cap deploy . Another possible solution: add asset_sync back to your Gemfile.

As last resort, you can run cap -d deploy . It will run deployment step-by-step, asking you for continue on each step. Login to production server in separate shell and do some adjustments between steps manually.

It looks like the Gemfile change didn't go well. How it was fixed:

  1. logged into server, there were 6 ruby processes that were taking all available things. This is almost certainly the unicorn processes trying to start and couldn't… killall -9 ruby
  2. cd into the app's current directory
  3. RAILS_ENV=production bundle exec rake assets:precompile
  4. service unicorn_whimseybox start

It looks like (in the unicorn.log), the error was: E, [2012-07-26T17:27:10.552912 #24818] ERROR -- : uninitialized constant AssetSync (NameError)

I had the same error after converting some Gemfile source lines into blocks.

The error was due an old Bundler version on production (1.7.3) vs 1.8.3 on development.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM