applicationsonline / librarian

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

errors installing rvm_passenger v0.8.2 ... however v0.8.0 works fine ??? #133

Open stepheneb opened 11 years ago

stepheneb commented 11 years ago

Am using librarian 0.0.26.

This Chefile spec for rvm_passenger works fine:

cookbook 'rvm_passenger', :git => 'git://github.com/fnichol/chef-rvm_passenger.git', :ref => 'v0.8.0'

However trying to update to v0.8.2 causes the undefined method `correct?' error:

cookbook 'rvm_passenger', :git => 'git://github.com/fnichol/chef-rvm_passenger.git', :ref => 'v0.8.2'

I tried to simplify the problem and got a different error.

I deleted librarian's cache in the tmp dir and then tried to update just rvm_passenger

$ librarian-chef update --verbose rvm_passenger
[Librarian] Ruby Version: 1.9.3
[Librarian] Ruby Platform: x86_64-darwin10.8.0
[Librarian] Rubygems Version: 1.8.25
[Librarian] Librarian Version: 0.0.26
[Librarian] Librarian Adapter: chef
[Librarian] Project: /Users/stephen/dev/concord/lab/config/littlechef
[Librarian] Specfile: Cheffile
[Librarian] Lockfile: Cheffile.lock
[Librarian] Git: /usr/local/bin/git
[Librarian] Git Version: git version 1.8.0.2
[Librarian] Git Environment Variables:
[Librarian]   (empty)
[Librarian] Pre-Cached Sources:
[Librarian]   [:site, "http://community.opscode.com/api/v1", {}]
[Librarian]   [:git, "git://github.com/opscode-cookbooks/java.git", {}]
[Librarian]   [:git, "git://github.com/mdxp/nodejs-cookbook.git", {}]
[Librarian]   [:git, "git://github.com/balbeko/chef-npm.git", {}]
[Librarian]   [:git, "git://github.com/fnichol/chef-rvm.git", {}]
[Librarian]   [:git, "git://github.com/fnichol/chef-rvm_passenger.git", {:ref=>"v0.8.0"}]
[Librarian]   [:git, "git://github.com/phlipper/chef-zip.git", {}]
[Librarian]   [:git, "git://github.com/realityforge/chef-authbind.git", {}]
[Librarian] Post-Cached Sources:
[Librarian]   [:site, "http://community.opscode.com/api/v1", {}]
[Librarian]   [:git, "git://github.com/opscode-cookbooks/java.git", {}]
[Librarian]   [:git, "git://github.com/mdxp/nodejs-cookbook.git", {}]
[Librarian]   [:git, "git://github.com/balbeko/chef-npm.git", {}]
[Librarian]   [:git, "git://github.com/fnichol/chef-rvm.git", {}]
[Librarian]   [:git, "git://github.com/fnichol/chef-rvm_passenger.git", {:ref=>"v0.8.0"}]
[Librarian]   [:git, "git://github.com/phlipper/chef-zip.git", {}]
[Librarian]   [:git, "git://github.com/realityforge/chef-authbind.git", {}]
[Librarian]   [:git, "git://github.com/fnichol/chef-rvm_passenger.git", {:ref=>"v0.8.2"}]
[Librarian] Analyzing spec and lock:
[Librarian]   Removed:
[Librarian]   ExplicitRemoved:
[Librarian]   Added:
[Librarian]   NonMatchingAdded:
[Librarian]   Changed:
[Librarian]     rvm_passenger
[Librarian]   DeepKeep:
[Librarian]     apache2
[Librarian]     apt
[Librarian]     authbind
[Librarian]     couchdb
[Librarian]     emacs
[Librarian]     git
[Librarian]     java
[Librarian]     maven
[Librarian]     nodejs
[Librarian]     npm
[Librarian]     rvm
[Librarian]     sudo
[Librarian]     users
[Librarian]     zip
[Librarian]   ShallowStrip:
[Librarian]     rvm_passenger
/Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/manifest_set.rb:141:in `dependencies_of': undefined method `dependencies' for nil:NilClass (NoMethodError)
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/manifest_set.rb:79:in `deep_strip!'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/manifest_set.rb:20:in `deep_strip'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/action/update.rb:20:in `run'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:172:in `update!'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:114:in `update'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/thor-0.16.0/lib/thor.rb:275:in `dispatch'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:26:in `block (2 levels) in bin!'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:31:in `returning_status'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:26:in `block in bin!'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:47:in `with_environment'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:26:in `bin!'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/bin/librarian-chef:7:in `<top (required)>'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/bin/librarian-chef:19:in `load'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/bin/librarian-chef:19:in `<main>'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/bin/ruby_noexec_wrapper:14:in `<main>'
yfeldblum commented 11 years ago

The second error is different from the first error because thor, the CLI framework that we use, requires positional arguments (rvm_passenger) to come before named arguments (--verbose). In other words, add --verbose to the end of the command rather than in the middle.

stepheneb commented 11 years ago

I get the same error if I remove --verbose

$ librarian-chef update rvm_passenger
/Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/manifest_set.rb:141:in `dependencies_of': undefined method `dependencies' for nil:NilClass (NoMethodError)
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/manifest_set.rb:79:in `deep_strip!'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/manifest_set.rb:20:in `deep_strip'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/action/update.rb:20:in `run'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:172:in `update!'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:114:in `update'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/thor-0.17.0/lib/thor/task.rb:27:in `run'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/thor-0.17.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/thor-0.17.0/lib/thor.rb:344:in `dispatch'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/thor-0.17.0/lib/thor/base.rb:434:in `start'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:26:in `block (2 levels) in bin!'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:31:in `returning_status'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:26:in `block in bin!'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:47:in `with_environment'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/lib/librarian/cli.rb:26:in `bin!'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/gems/librarian-0.0.26/bin/librarian-chef:7:in `<top (required)>'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/bin/librarian-chef:19:in `load'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/bin/librarian-chef:19:in `<main>'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/stephen/.rvm/gems/ruby-1.9.3-p392@lab/bin/ruby_noexec_wrapper:14:in `<main>'
yfeldblum commented 11 years ago

The line you gave above - is that the full Cheffile or just the relevant part of it?

stepheneb commented 11 years ago

Here's the full Cheffile:

https://github.com/concord-consortium/littlechef-servers/blob/ruby-lab-server-update/Cheffile

yfeldblum commented 11 years ago

Thanks!

yfeldblum commented 11 years ago

Gisted for future reference.

The rvm_passenger cookbook adds some constraints between v0.8.0 and v0.8.2. Librarian's resolver seems not to be handling this case well.

For now, you can force the upgrade by

lukeasrodgers commented 9 years ago

FWIW I ran into a similar issue, which was due to the old cookbook I was using not having a name attribute in metadata.rb (https://github.com/opscode/chef/issues/1712). librarian-chef install fixed the issue.

heaven commented 7 years ago

This error is still there, there's nothing about the particular cookbook, just tried librarian update postgresql and got the same error.

Was able to fix by replacing this line https://github.com/applicationsonline/librarian/blob/master/lib/librarian/manifest_set.rb#L140 with the following:

names.concat index[name] ? index[name].dependencies.map(&:name) : []