boxen / our-boxen

Copy me for your team.
https://github.com/boxen/our-boxen/
MIT License
2.58k stars 882 forks source link

There was an error in your Gemfile, and Bundler cannot continue. #312

Closed pencilcheck closed 11 years ago

pencilcheck commented 11 years ago

I am getting this error recently, and I took out every new changes I made but it still spitting errors.

/o/b/bin ❯❯❯ boxen --debug
Username for 'https://github.com': pencilcheck Password for 'https://pencilcheck@github.com': Boxen's master branch is out of sync, won't auto-update! /opt/boxen/repo/bin/librarian-puppet install --path=/opt/boxen/repo/shared --verbose There was an error in your Gemfile, and Bundler cannot continue. Can't run Puppet, fetching dependencies with librarian failed.

After running the command directly, I got this:

/o/b/bin ❯❯❯ /opt/boxen/repo/bin/librarian-puppet install --path=/opt/boxen/repo/shared --verbose [Librarian] Ruby Version: 2.0.0 [Librarian] Ruby Platform: x86_64-darwin12.3.0 [Librarian] Rubygems Version: 2.0.0 [Librarian] Librarian Version: 0.0.24 [Librarian] Librarian Adapter: puppet [Librarian] Project: /opt/boxen/bin [Librarian] Specfile: Puppetfile [Librarian] Lockfile: Puppetfile.lock [Librarian] Git: /opt/boxen/homebrew/bin/git [Librarian] Git Version: git version 1.8.2 [Librarian] Git Environment Variables: Librarian /opt/boxen/repo/.bundle/ruby/2.0.0/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/specfile.rb:14:in read': No such file or directory - /opt/boxen/bin/Puppetfile (Errno::ENOENT) from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/specfile.rb:14:inread' from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/specfile.rb:14:in read' from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/action/resolve.rb:12:inrun' from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/cli.rb:161:in resolve!' from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/librarian-puppet-0.9.9/lib/librarian/puppet/cli.rb:63:ininstall' from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/thor-0.18.1/lib/thor/command.rb:27:in run' from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:ininvoke_command' from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/thor-0.18.1/lib/thor.rb:363:in dispatch' from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/thor-0.18.1/lib/thor/base.rb:439:instart' from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/cli.rb:29:in bin!' from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/librarian-puppet-0.9.9/bin/librarian-puppet:9:in<top (required)>' from /opt/boxen/repo/bin/librarian-puppet:16:in load' from /opt/boxen/repo/bin/librarian-puppet:16:in

'

I don't know how it is thinking that Puppetfile is in bin folder

rafaelfranca commented 11 years ago

What is the content of your Gemfile and Gemfile.lock?

On Thursday, June 20, 2013, Penn Su wrote:

I am getting this error recently, and I took out every new changes I made but it still spitting errors.

/o/b/bin ❯❯❯ boxen --debug

Username for 'https://github.com': pencilcheck Password for 'https://pencilcheck@github.com <javascript:_e({}, 'cvml', 'pencilcheck@github.com');>': Boxen's master branch is out of sync, won't auto-update! /opt/boxen/repo/bin/librarian-puppet install --path=/opt/boxen/repo/shared --verbose There was an error in your Gemfile, and Bundler cannot continue. Can't run Puppet, fetching dependencies with librarian failed.

— Reply to this email directly or view it on GitHubhttps://github.com/boxen/our-boxen/issues/312 .

Rafael Mendonça França http://twitter.com/rafaelfranca https://github.com/rafaelfranca

pencilcheck commented 11 years ago

Gemfile http://pastebin.com/GcQ0uTA9

Gmefile.lock http://pastebin.com/UKDr1PBC

pencilcheck commented 11 years ago

I think I found some typos in my Puppetfile by nuking everything and reinstall boxen where it finally prints out the error lines on first initial installation. I think it would cost less time and energy to solve this issue if boxen --debug actually works….

pencilcheck commented 11 years ago

Actually, the error continues after initial installation…

Now the error is something about some gem not found, after I delete .bundle folder and start over again.

/Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/spec_set.rb:90:in materialize': Could not find addressable-2.3.4 in any of the sources (Bundler::GemNotFound) from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/spec_set.rb:83:inmap!' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/spec_set.rb:83:in materialize' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/definition.rb:113:inspecs' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/definition.rb:158:in specs_for' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/definition.rb:147:inrequested_specs' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/environment.rb:23:in requested_specs' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/runtime.rb:11:insetup' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler.rb:116:in setup' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/setup.rb:17 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:ingem_original_require' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in require' from ./config/basic.rb:23 from /opt/boxen/bin/boxen-git-credential:22:inload' from /opt/boxen/bin/boxen-git-credential:22 Username for 'https://github.com': pencilcheck Password for 'https://pencilcheck@github.com': /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/spec_set.rb:90:in materialize': Could not find addressable-2.3.4 in any of the sources (Bundler::GemNotFound) from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/spec_set.rb:83:inmap!' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/spec_set.rb:83:in materialize' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/definition.rb:113:inspecs' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/definition.rb:158:in specs_for' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/definition.rb:147:inrequested_specs' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/environment.rb:23:in requested_specs' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/runtime.rb:11:insetup' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler.rb:116:in setup' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.5/lib/bundler/setup.rb:17 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:ingem_original_require' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in require' from ./config/basic.rb:23 from /opt/boxen/bin/boxen-git-credential:22:inload' from /opt/boxen/bin/boxen-git-credential:22 Boxen has a dirty tree, won't auto-update! There was an error in your Gemfile, and Bundler cannot continue. Can't run Puppet, fetching dependencies with librarian failed.

rafaelfranca commented 11 years ago

Seen in the first run you were running boxen with Ruby 2.0.0. I think puppet doesn't work very well with this version.

The second run you are using system ruby but you didn't have the gems installed. You have to run bundle install first since you removed the .bundle folder where are all the gems.

Could you try and report back?

pencilcheck commented 11 years ago

I ran bundle install and still get an error when I run boxen again

Boxen has a dirty tree, won't auto-update! /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1414:in fu_each_src_dest0': undefined methodto_str' for nil:NilClass (NoMethodError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1400:in fu_each_src_dest' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:423:incp_r' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/lib/librarian/puppet/source/githubtarball.rb:60:in install_version!' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/lib/librarian/puppet/source/githubtarball.rb:208:ininstall!' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/manifest.rb:89:in install!' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/action/install.rb:49:ininstall_manifests' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/action/install.rb:48:in each' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/action/install.rb:48:ininstall_manifests' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/action/install.rb:39:in perform_installation' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/action/install.rb:12:inrun' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/cli.rb:157:in install!' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/lib/librarian/puppet/cli.rb:64:ininstall' from /opt/boxen/repo/.bundle/ruby/1.8/gems/thor-0.18.1/lib/thor/command.rb:27:in __send__' from /opt/boxen/repo/.bundle/ruby/1.8/gems/thor-0.18.1/lib/thor/command.rb:27:inrun' from /opt/boxen/repo/.bundle/ruby/1.8/gems/thor-0.18.1/lib/thor/invocation.rb:120:in invoke_command' from /opt/boxen/repo/.bundle/ruby/1.8/gems/thor-0.18.1/lib/thor.rb:363:indispatch' from /opt/boxen/repo/.bundle/ruby/1.8/gems/thor-0.18.1/lib/thor/base.rb:439:in start' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/cli.rb:29:inbin!' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/bin/librarian-puppet:9 from /opt/boxen/repo/bin/librarian-puppet:16:in `load' from /opt/boxen/repo/bin/librarian-puppet:16 Can't run Puppet, fetching dependencies with librarian failed.

rafaelfranca commented 11 years ago

Now some of the files what are inside the vendor/puppet/cache/ are corrupted

ocxo commented 11 years ago

This should get you in a clean state: rm -rf /opt/boxen/repo/.{tmp,librarian}

pencilcheck commented 11 years ago

Thanks for the help, I ran your command to remove the tmp files, but still having errors when I run boxen:

Boxen has a dirty tree, won't auto-update! tar: Error opening archive: Failed to open 'sparrow' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1414:in fu_each_src_dest0': undefined methodto_str' for nil:NilClass (NoMethodError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1400:in fu_each_src_dest' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:423:incp_r' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/lib/librarian/puppet/source/githubtarball.rb:60:in install_version!' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/lib/librarian/puppet/source/githubtarball.rb:208:ininstall!' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/manifest.rb:89:in install!' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/action/install.rb:49:ininstall_manifests' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/action/install.rb:48:in each' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/action/install.rb:48:ininstall_manifests' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/action/install.rb:39:in perform_installation' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/action/install.rb:12:inrun' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/cli.rb:157:in install!' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/lib/librarian/puppet/cli.rb:64:ininstall' from /opt/boxen/repo/.bundle/ruby/1.8/gems/thor-0.18.1/lib/thor/command.rb:27:in __send__' from /opt/boxen/repo/.bundle/ruby/1.8/gems/thor-0.18.1/lib/thor/command.rb:27:inrun' from /opt/boxen/repo/.bundle/ruby/1.8/gems/thor-0.18.1/lib/thor/invocation.rb:120:in invoke_command' from /opt/boxen/repo/.bundle/ruby/1.8/gems/thor-0.18.1/lib/thor.rb:363:indispatch' from /opt/boxen/repo/.bundle/ruby/1.8/gems/thor-0.18.1/lib/thor/base.rb:439:in start' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/vendor/librarian/lib/librarian/cli.rb:29:inbin!' from /opt/boxen/repo/.bundle/ruby/1.8/gems/librarian-puppet-0.9.9/bin/librarian-puppet:9 from /opt/boxen/repo/bin/librarian-puppet:16:in `load' from /opt/boxen/repo/bin/librarian-puppet:16 Can't run Puppet, fetching dependencies with librarian failed.

rafaelfranca commented 11 years ago

@pencilcheck seems your internet connection is not helping. It is still the same problem with the compressed files

pencilcheck commented 11 years ago

So this is a bug with ruby 2.0? or is it something else?

rafaelfranca commented 11 years ago

No, it is a problem with internet connection

pencilcheck commented 11 years ago

What do you mean? My internet connection? I'm connected now aren't I?

rafaelfranca commented 11 years ago

For some reason, the files that are downloaded from internet are empty. So you have to remove these files with rm -rf /opt/boxen/repo/.{tmp,librarian} like @fromonesrc said.

pencilcheck commented 11 years ago

Clean up didn't work.

pencilcheck commented 11 years ago

It's weird how the default modules that came with our-boxen have no problem at all, but once I start adding other modules I found on github, it starts to break down.

It never happen before when I first installed it (like when I first discovered this project and downloaded the program and try things out). It starts after a few runs.

Oh and btw, I only get a different error message in ruby 2.0 (Could not find addressable-2.3.4 in any of the sources), but all other rubies like system to 1.9.3 are all the same.

And the weirdest thing is when i am in ruby 2.0, I run boxen --debug and it seems to be looking in where they store gems for ruby 1.8 (might be the system ruby), instead of where 2.0 should be. I am sure that I run rbenv rehash after each ruby switch, and when I do rbenv whence bundle it will say command not found, and no matter what I do, like installing bundler with rubygems, I just can't get bundler to work under ruby 2.0 with rbenv. Of course rbenv is installed via boxen.

rafaelfranca commented 11 years ago

It's weird how the default modules that came with our-boxen have no problem at all, but once I start adding other modules I found on github, it starts to break down.

This is due problem with the internet connection. Something is stoping the download of the new module, so it is falling. You don't get this error with the already included modules because they are inside the repository.

I got this error sometimes and all that I need to do is remove the files on vendor/puppet/cache/ and try again with a better internet connection.

pencilcheck commented 11 years ago

I don't know why it is internet connection issue if I can go online, browse webpages, and download the core modules without problem.

rafaelfranca commented 11 years ago

Me neither. But it can be problem between you machine and the servers with the librarian files. Everything is fine here with all the ruby versions. Try to cleanup the tmp and cache files.

pencilcheck commented 11 years ago

Ah, it's interesting how boxen can't download ruby with tag 6.0.0, can you try that on your side? because that is something different.

rafaelfranca commented 11 years ago

I just tested here and everything is fine

pencilcheck commented 11 years ago

I still can't believe it's a network issue. Is there a way to see if it is downloading the right file from the right url?

rafaelfranca commented 11 years ago

yes, see if the file inside vendor/puppet/cache/ for the version of the project you are adding can be extracted.

pencilcheck commented 11 years ago

I just nuked my copy and start all over with our-boxen, and changed ruby to 6.0.0, and it still failed with the same error, but it seems like it downloaded all tar.gz successfully in vender/puppet/cache/, I see boxen-puppet-ruby-6.0.0.tar.gz in there, and all other modules. Not only that, all of the archives seems to be ok and can be extracted.

rafaelfranca commented 11 years ago

.tmp was cleaned too?

pencilcheck commented 11 years ago

I didn't clean .tmp, because that's the first time I run script/boxen after I git clone from github.

rafaelfranca commented 11 years ago

So I'm sorry I'm out of solutions. I just did the nuke and everything worked fine here.

pencilcheck commented 11 years ago

Ah, interesting, after deleting .tmp and .librarian, now it says it couldn't find xquartz, so I guess it is working.

pencilcheck commented 11 years ago

I think boxen should be more careful in using the cache files, and produce more accurate dependency errors, because I just found out that puppet-ruby depends on repository version > 2.1.0 and xquartz for OSX, and now I changed the versions in Puppetfile now it is installing correctly for ruby 6.0.0 however none of the errors indicate any hints on that direction. It's frustrating, I wish boxen can be more debugging friendly. But thanks for sticking with me, without it I might give up on boxen.

rafaelfranca commented 11 years ago

The dependencies are listed on the README. I think @wfarr is working in a new dependence management.

About the cache files you should include the vendor/puppet/cache/ on you repository.

Can I close this issue?

pencilcheck commented 11 years ago

Let me try it on my own boxen first, then if everything is ok, I will close this issue.

pencilcheck commented 11 years ago

Now it works as well on my boxen, I will close this issue. Thanks all for the help.