-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
passenger version & dry-run: undefined method `[]' for nil:NilClass #20
Comments
It's failing because in --dry-run, we don't actually run any commands, so we can't guess the passenger version. There's really no reasonable way to work around this, other than to log a fatal error and exit. I'm going to make this a more graceful process. |
Thanks for your answer. |
That may be one possible reasonable definition of dry run, but unfortunately, that's not how it's currently implemented in capistrano 3. A dry-run simply prints out all the commands it would run. capistrano-passenger runs a command, and uses the result to decide what command to do next. If we just print out the command, but don't actually run it on the host, then we can't print out the next command, because we don't know what the next command will be. We can stub a result (which other capistrano add-ons appear to do accidentally), but that would be misleading, if the intention is to give you a realistic idea of what commands will be run in real life. Anyway, pull the latest from github and you'll see how I work around this. I'm planning on releasing an updated gem soon but waiting for feedback on a few issues first. |
Got same error today, after debugging, found out it's because the remote command "passenger -v" is getting some error messages from rvm before the actually version showed up. In my case, they are something like
Because of these, the regular expression used to get version number returned nill, so the exception was throwed. Get rid of the warning message by running passenger -v command fixed the issue. Maybe a throught match for multiline is better in this case. |
@pzgz Sounds reasonable. A PR would be welcome. |
For capistrano#20 , if the version info returned by `passenger -v` is not the first line, the original regular expression will return nil so that error will be raised. This might happen sometime, such as RVM might give a warning when running a command.
For #20 , if the version info returned by `passenger -v` is not the first line, the original regular expression will return nil so that error will be raised. This might happen sometime, such as RVM might give a warning when running a command.
I also start to have this problem (not using dry run) after updating to passenger 5.0.10. |
But i seem unable to use bleeding edge |
Right, i had to build the gem. $ cd `bundle show capistrano-passenger`
$ gem build capistrano-passenger.gemspec
$ gem install capistrano-passenger-0.1.0.gem |
I was running a dry-run with the following configuration and got an unexpected exception while running deploy:
/home/michael/.rvm/gems/ruby-1.9.3-p551/bin/cap development deploy --dry-run --trace
Capfile
config/deploy.rb
config/deploy/development.rb
Log
Environment on the host machine
Apache 2.4 + passenger 4.0.56
Gemfile.lock
The text was updated successfully, but these errors were encountered: