applicationsonline / librarian

Librarian - A Framework for Bundlers. Librarian-Chef is at: https://github.com/applicationsonline/librarian-chef.
http://applicationsonline.com/
MIT License
655 stars 71 forks source link

resolution can be nil in persist_resolution if dependencies were not resolved #145

Closed carlossg closed 11 years ago

carlossg commented 11 years ago

If none of the dependencies can be resolved the resolution object is nil in persist_resolution. Check and print the "Could not resolve the dependencies." message

/Users/csanchez/.rvm/gems/ruby-1.9.3-p327/gems/librarian-0.1.0/lib/librarian/action/persist_resolution_mixin.rb:11:in `persist_resolution': undefined method `correct?' for nil:NilClass (NoMethodError)
from /Users/csanchez/.rvm/gems/ruby-1.9.3-p327/gems/librarian-0.1.0/lib/librarian/action/resolve.rb:27:in `run'
from /Users/csanchez/.rvm/gems/ruby-1.9.3-p327/gems/librarian-0.1.0/lib/librarian/cli.rb:169:in `resolve!'
from /Users/csanchez/dev/librarian-puppet/lib/librarian/puppet/cli.rb:63:in `install'
from /Users/csanchez/.rvm/gems/ruby-1.9.3-p327/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
from /Users/csanchez/.rvm/gems/ruby-1.9.3-p327/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
from /Users/csanchez/.rvm/gems/ruby-1.9.3-p327/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
from /Users/csanchez/.rvm/gems/ruby-1.9.3-p327/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from /Users/csanchez/.rvm/gems/ruby-1.9.3-p327/gems/librarian-0.1.0/lib/librarian/cli.rb:26:in `block (2 levels) in bin!'
from /Users/csanchez/.rvm/gems/ruby-1.9.3-p327/gems/librarian-0.1.0/lib/librarian/cli.rb:31:in `returning_status'
from /Users/csanchez/.rvm/gems/ruby-1.9.3-p327/gems/librarian-0.1.0/lib/librarian/cli.rb:26:in `block in bin!'
from /Users/csanchez/.rvm/gems/ruby-1.9.3-p327/gems/librarian-0.1.0/lib/librarian/cli.rb:47:in `with_environment'

from /Users/csanchez/.rvm/gems/ruby-1.9.3-p327/gems/librarian-0.1.0/lib/librarian/cli.rb:26:in `bin!'
from ./bin/librarian-puppet:7:in `<main>'
iartarisi commented 11 years ago

+1 I keep running into this, too. I'm not sure this is the best solution; it would be better to have print the dependency ("resolution") problem to the user instead.

gregkare commented 11 years ago

This issue is happening all the time when using librarian-chef and downgrading cookbook versions from the Cheffile. This is confusing, do you think you can push a new release to include this fix? In the case of downgrading, running librarian-chef update sorts everything out. That could be displayed to the user as an info message.

yfeldblum commented 11 years ago

This is released in v0.1.1.

hannesg commented 11 years ago

\o/ I'll test this tomorrow morning