Search code examples
ruby-on-railsdeploymentcapistrano

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?


Solution

  • 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)