{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/1827","repository_url":"https://api.github.com/repos/Homebrew/homebrew-core","labels_url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/1827/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/1827/comments","events_url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/1827/events","html_url":"https://github.com/Homebrew/homebrew-core/issues/1827","id":159273927,"number":1827,"title":"Brew install fails with error \"undefined method 'default_spec_cache_dir'\"","user":{"login":"coryfklein","id":3503322,"avatar_url":"https://avatars.githubusercontent.com/u/3503322?v=3","gravatar_id":"","url":"https://api.github.com/users/coryfklein","html_url":"https://github.com/coryfklein","followers_url":"https://api.github.com/users/coryfklein/followers","following_url":"https://api.github.com/users/coryfklein/following{/other_user}","gists_url":"https://api.github.com/users/coryfklein/gists{/gist_id}","starred_url":"https://api.github.com/users/coryfklein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coryfklein/subscriptions","organizations_url":"https://api.github.com/users/coryfklein/orgs","repos_url":"https://api.github.com/users/coryfklein/repos","events_url":"https://api.github.com/users/coryfklein/events{/privacy}","received_events_url":"https://api.github.com/users/coryfklein/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Homebrew/homebrew-core/labels/needs%20response","name":"needs response","color":"c7def8"},{"url":"https://api.github.com/repos/Homebrew/homebrew-core/labels/user%20configuration","name":"user configuration","color":"0b02e1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-08T21:14:12Z","updated_at":"2016-06-13T17:56:34Z","closed_at":null,"body":"I've upgraded, updated, doctored, and permissioned brew:\r\n\r\n```\r\n$ brew upgrade\r\n$ brew update\r\nAlready up-to-date.\r\n$ brew update\r\nAlready up-to-date.\r\n$ brew doctor\r\nYour system is ready to brew.\r\n$ sudo chown -R $(whoami) $(brew --prefix)\r\nPassword:\r\n$\r\n```\r\n\r\n### Bug reports:\r\n\r\nSome `brew install` commands fail with the error `Error: undefined method 'default_spec_cache_dir' for Gem:Module`\r\n\r\n```\r\n$ brew install Caskroom/cask/brew-cask\r\n==> brew cask install Caskroom/cask/brew-cask\r\nError: undefined method `default_spec_cache_dir' for Gem:Module\r\nPlease report this bug:\r\n    https://git.io/brew-troubleshooting\r\n/Library/Ruby/Site/2.0.0/rubygems/path_support.rb:38:in `initialize'\r\n/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:357:in `new'\r\n/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:357:in `paths'\r\n/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:379:in `path'\r\n/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:794:in `dirs'\r\n/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:658:in `each_normal'\r\n/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:669:in `_all'\r\n/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:822:in `each'\r\n/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:864:in `find'\r\n/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:864:in `find_inactive_by_path'\r\n/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:175:in `try_activate'\r\n/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'\r\n/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'\r\n/usr/local/Library/brew.rb:22:in `require?'\r\n/usr/local/Library/brew.rb:61:in `<main>'\r\n```\r\n\r\nI tried to resolve this by upgrading the version of ruby that brew uses, since `2.0.0` releases can often be unstable.\r\n\r\nLooking at `/usr/local/Library/brew.rb`, it is clear that without setting `HOMEBREW_DEVELOPER`, brew will use the version of ruby defined in `/System/Library/Frameworks/Ruby.framework/Versions/Current`. Most sources online recommend using `rvm` to manage ruby installation versions, but brew provides no way to use rvm installed ruby versions instead of the OS X default version.\r\n\r\nOS X also does not allow updating its current version of Ruby.\r\n\r\n```\r\n$ sudo rm -rf /System/Library/Frameworks/Ruby.framework/Versions/Current\r\nrm: /System/Library/Frameworks/Ruby.framework/Versions/Current: Operation not permitted\r\n```\r\n\r\nWhat do you think about updating `/usr/local/Library/brew.rb` to **not** be hard-coded to the OS X system default ruby version?\r\n\r\nReproduced on OS X El Capitan 10.11.5"},"comment":{"url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/comments/225658507","html_url":"https://github.com/Homebrew/homebrew-core/issues/1827#issuecomment-225658507","issue_url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/1827","id":225658507,"user":{"login":"coryfklein","id":3503322,"avatar_url":"https://avatars.githubusercontent.com/u/3503322?v=3","gravatar_id":"","url":"https://api.github.com/users/coryfklein","html_url":"https://github.com/coryfklein","followers_url":"https://api.github.com/users/coryfklein/followers","following_url":"https://api.github.com/users/coryfklein/following{/other_user}","gists_url":"https://api.github.com/users/coryfklein/gists{/gist_id}","starred_url":"https://api.github.com/users/coryfklein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coryfklein/subscriptions","organizations_url":"https://api.github.com/users/coryfklein/orgs","repos_url":"https://api.github.com/users/coryfklein/repos","events_url":"https://api.github.com/users/coryfklein/events{/privacy}","received_events_url":"https://api.github.com/users/coryfklein/received_events","type":"User","site_admin":false},"created_at":"2016-06-13T17:56:34Z","updated_at":"2016-06-13T17:56:34Z","body":"I reverted my modifications to `/usr/local/Library/brew.rb`.\r\n\r\nI haven't modified `RUBYOPT` or `RUBYLIB` and `~/.gemrc` doesn't exist.\r\n\r\n```\r\n$ echo $RUBYOPT\r\n\r\n$ echo $RUBYLIB\r\n\r\n$ ls ~/.gemrc\r\nls: /Users/coryklein/.gemrc: No such file or directory\r\n```\r\n\r\nRunning `/usr/bin/irb` does reproduce the issue:\r\n\r\n```\r\n$ /usr/bin/irb\r\n/Library/Ruby/Site/2.0.0/rubygems/path_support.rb:38:in `initialize': undefined method `default_spec_cache_dir' for Gem:Module (NoMethodError)\r\n\tfrom /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:357:in `new'\r\n\tfrom /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:357:in `paths'\r\n### SNIP ###\r\n```\r\n\r\n## Solution\r\n\r\nIn my case, moving `rubygems` resolved the problem\r\n\r\n```\r\nmv /Library/Ruby/Site/2.0.0/rubygems /Library/Ruby/Site/2.0.0/rubygems.bak\r\n```\r\n\r\n@UniqMartin Thanks for your help."}}
{"actor":{"display_login":"coryfklein"}}