"unknown option: --roles" while updating from 0.7.3 to 0.8.0 #275

Closed
Envek opened this Issue Dec 10, 2012 · 9 comments

Comments

Projects
None yet
7 participants

Envek commented Dec 10, 2012

I've updated my bundle after few months, and cap deploy now failing, complains, that there is no --roles option for whenever.

My deploy.rb (I think lines 22-24 are the guilty ones).
What gems was updated by bundle update here (I've manually rolled back to 0.7.3 version).

I think it's related to #269 and #271.

Capistrano log (with whenever 0.8.0 in Gemfile.lock):

  * 2012-12-10 14:23:42 executing `deploy'
  * 2012-12-10 14:23:42 executing `deploy:update'
 ** transaction: start
  * 2012-12-10 14:23:42 executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote git@github.com:AmurSU/simple_catalog.git master"
    command finished in 4994ms
  * executing "if [ -d /srv/simple_catalog/shared/cached-copy ]; then cd /srv/simple_catalog/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 1f59c1397591ec9b61293d2d29ec5bb9756e186f && git clean -q -d -x -f; else git clone -q git@github.com:AmurSU/simple_catalog.git /srv/simple_catalog/shared/cached-copy && cd /srv/simple_catalog/shared/cached-copy && git checkout -q -b deploy 1f59c1397591ec9b61293d2d29ec5bb9756e186f; fi"
    servers: ["taurus.amursu.ru"]
    [simple_catalog@taurus.amursu.ru] executing command
    command finished in 14709ms
    copying the cached version to /srv/simple_catalog/releases/20121210042402
  * executing "cp -RPp /srv/simple_catalog/shared/cached-copy /srv/simple_catalog/releases/20121210042402 && (echo 1f59c1397591ec9b61293d2d29ec5bb9756e186f > /srv/simple_catalog/releases/20121210042402/REVISION)"
    servers: ["taurus.amursu.ru"]
    [simple_catalog@taurus.amursu.ru] executing command
    command finished in 4962ms
  * 2012-12-10 14:24:07 executing `deploy:finalize_update'
    triggering before callbacks for `deploy:finalize_update'
  * 2012-12-10 14:24:07 executing `whenever:update_crontab'
  * executing "cd /srv/simple_catalog/releases/20121210042402 && bundle exec whenever --update-crontab simple_catalog --set environment=production --roles db"
    servers: ["taurus.amursu.ru"]
    [simple_catalog@taurus.amursu.ru] executing command
 ** [out :: simple_catalog@taurus.amursu.ru] bundler: command not found: whenever
 ** [out :: simple_catalog@taurus.amursu.ru] Install missing gem executables with `bundle install`
 ** [out :: simple_catalog@taurus.amursu.ru] 
    command finished in 910ms
*** [whenever:update_crontab] rolling back
  * executing "ls -x /srv/simple_catalog/releases"
    servers: ["taurus.amursu.ru"]
    [simple_catalog@taurus.amursu.ru] executing command
    command finished in 686ms
  * executing "cd /srv/simple_catalog/releases/20120903051240 && bundle exec whenever --update-crontab simple_catalog --set environment=production --roles db"
    servers: ["taurus.amursu.ru"]
    [simple_catalog@taurus.amursu.ru] executing command
 ** [out :: simple_catalog@taurus.amursu.ru] /srv/simple_catalog/shared/bundle/ruby/1.9.1/gems/whenever-0.7.3/bin/whenever:9:in `<top (required)>': invalid option: --roles (OptionParser::InvalidOption)
 ** [out :: simple_catalog@taurus.amursu.ru] from /srv/simple_catalog/shared/bundle/ruby/1.9.1/bin/whenever:23:in `load'
 ** [out :: simple_catalog@taurus.amursu.ru] from /srv/simple_catalog/shared/bundle/ruby/1.9.1/bin/whenever:23:in `<main>'
    command finished in 2289ms
 ** [whenever:update_crontab] exception while rolling back: Capistrano::CommandError, failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.3' -c 'cd /srv/simple_catalog/releases/20120903051240 && bundle exec whenever --update-crontab simple_catalog --set environment=production --roles db'" on simple_catalog@taurus.amursu.ru
*** [deploy:update_code] rolling back
  * executing "rm -rf /srv/simple_catalog/releases/20121210042402; true"
    servers: ["taurus.amursu.ru"]
    [simple_catalog@taurus.amursu.ru] executing command
    command finished in 719ms
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.3' -c 'cd /srv/simple_catalog/releases/20121210042402 && bundle exec whenever --update-crontab simple_catalog --set environment=production --roles db'" on simple_catalog@taurus.amursu.ru

recmend commented Dec 11, 2012

I had the same issue, reverted to 0.7

Skulli commented Dec 13, 2012

having the same problem, downgraded as well

Owner

javan commented Dec 13, 2012

Can you try requiring whenever after bundler in your deploy.rb if you aren't already?

rywall commented Dec 14, 2012

You need to upgrade the version of bundler you are using: bundler/bundler@5d518be

Envek commented Dec 14, 2012

@javan, it already placed after bundler

@rywall, Thank you very much. Updating bundler on local machine solved it!

$ bundle -v
Bundler version 1.1.3
$ gem update bundler
$ bundle -v
Bundler version 1.2.3

After that I've removed whenever version constraint from Gemfile, run bundle update, commited, pushed and cap deploy deployed my app SUCCESSFULLY.

Envek closed this Dec 14, 2012

Sorry, but I don't thins it's a good idea to break previous bundler versions compatibility

Owner

javan commented Dec 14, 2012

@averyanov it certainly wasn't intentional. Bundler and Whenever are doing a dance to find the best Capistrano hook.

mrbrdo commented Jun 12, 2013

this is still a problem.

Owner

javan commented Jun 14, 2013

@mrbrdo What version of Whenever do you have installed on your server (whenever -v)? Are you requiring whenever after bundler in your deploy.rb file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment