sinatra/sinatra-book

.bundle/config file content

Closed this issue · 2 comments

Do we really need this .bundle/config in repo? Because bundle install on OS X tries to install all required gems to /usr/local/ruby (which is not available on OS X by default) instead of /Library/Ruby/Gems/*?

cd .bundle/
mv config config.weird
fixes the issue

Full report below:

  • What did you do?

    I ran the command /usr/local/bin/bundle install

  • What did you expect to happen?

    I expected Bundler to output following:
    Using rake 0.9.2.2
    Using pdfkit 0.5.2
    Using rack 1.4.1
    Using rack-protection 1.2.0
    Using redcarpet 2.1.1
    Using tilt 1.3.3
    Using sinatra 1.3.3
    Using wkhtmltopdf-binary 0.9.9.1
    Using bundler 1.10.6
    Bundle complete! 5 Gemfile dependencies, 9 gems now installed.
    Use bundle show [gemname] to see where a bundled gem is installed.

  • What happened instead?

    Instead, what actually happened was...

Error details

Errno::EACCES: Permission denied - /usr/local/ruby
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in mkdir_p'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `each'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler.rb:308:in `mkdir_p'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/installer.rb:278:in `create_bundle_path'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/installer.rb:54:in `run'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/installer.rb:18:in `install'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/cli/install.rb:107:in `run'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/cli.rb:162:in `install'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/cli.rb:10:in `start'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/bin/bundle:20:in `block in <top (required)>'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/bin/bundle:18:in `<top (required)>'
  /usr/local/bin/bundle:23:in `load'
  /usr/local/bin/bundle:23:in `<main>'

Environment

Bundler   1.10.6
Rubygems  2.4.8
Ruby      2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]
GEM_HOME  /usr/local/ruby/2.0.0
GEM_PATH  
Git       2.3.8 (Apple Git-58)

Bundler settings

gem.coc
  Set for the current user (/Users/niemda/.bundle/config): "true"
gem.mit
  Set for the current user (/Users/niemda/.bundle/config): "false"
path
  Set for your local app (/Users/niemda/git/sinatra-book/.bundle/config): "/usr/local"
disable_shared_gems
  Set for your local app (/Users/niemda/git/sinatra-book/.bundle/config): "1"

--- TEMPLATE END ----------------------------------------------------------------

Unfortunately, an unexpected error occurred, and Bundler cannot continue.

zzak commented

I don't think this is related, we don't check in any .bundle/config file into git.

The command /usr/local/bin/bundle also seems weird, what happens when you just use bundle install without the full path? RubyGems is designed to handle PATH for you, so you don't have to type the full path to a gem's executable.

Everything work as is should of course. Weird.
Fresh re-clone of the repo does not contain this directory, but I can still retrieve corrupted repo from Time Machine. Weird.
You may close the issue as unrelated.