brunophilipe / Cakebrew

Manage your Homebrew formulas with style using Cakebrew.
http://www.cakebrew.com
GNU General Public License v3.0
4.81k stars 255 forks source link

Cakebrew won't load #171

Closed jpauwels closed 3 years ago

jpauwels commented 8 years ago

Same behaviour as #144. Tried all suggestions described there, then I found through ps that the cause of the hang is ruby $(brew --prefix)/Library/brew.rb config. When I try this in the Terminal, it returns:

/Users/johan/.homebrew/Library/Homebrew/os/mac.rb:27:in `full_version': undefined method `chomp' for nil:NilClass (NoMethodError)
from /Users/johan/.homebrew/Library/Homebrew/os.rb:17:in `<module:OS>'
from /Users/johan/.homebrew/Library/Homebrew/os.rb:1:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/johan/.homebrew/Library/Homebrew/global.rb:7:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/johan/.homebrew/Library/brew.rb:6:in `<main>'

The reason is that HOMEBREW_OSX_VERSION is only set in $(brew --prefix)/Library/brew.sh. Manually setting the env var before calling the ruby file (export HOMEBREW_OSX_VERSION="$(/usr/bin/sw_vers -productVersion)";ruby $(brew --prefix)/Library/brew.rb config) confirms that this causes the error. This is not a solution though, as the result indicates:

Error: HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!

Calling brew config directly from the command line works as expected:

HOMEBREW_VERSION: 0.9.9
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 146a16d66bc796f0c6a4c7e2b88f1b73fb0aaa4c
Last commit: 10 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: d475247f02aa5f05db076ed432cae4ae98475b17
Core tap last commit: 47 minutes ago
HOMEBREW_PREFIX: /Users/johan/.homebrew
HOMEBREW_REPOSITORY: /Users/johan/.homebrew
HOMEBREW_CELLAR: /Users/johan/.homebrew/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: dual-core 64-bit penryn
Clang: 7.3 build 703
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_92
System Ruby: 2.0.0-p648
OS X: 10.11.5-x86_64
Xcode: 7.3.1 => /Applications/Development/Xcode.app/Contents/Developer
CLT: N/A
X11: 2.7.9 => /opt/X11
brunophilipe commented 8 years ago

Hey! Which shell are you using?

jpauwels commented 8 years ago

The default bash of OS X 10.11.5

brunophilipe commented 8 years ago

Hmm these problems are usually caused by bad shell profile settings. Unfortunately there's not much more I can say. =/

As you can see on #144 it took literally months for someone to guess what was going wrong (and it turned out to be my fault from the beginning), so it is very hard to debug this kind of isolated problems.

I'm sorry that I can't help you. If you find anything new, please report to me so I can have a look. Thanks!

kerberjg commented 5 years ago

I managed to encounter the same issue. Cakebrew was installed via brew cask

Turns out it was just running brew update in the background, which just happens to be very slow

This issue could be easily avoided by simply showing something more precise than just "Loading", like "Updating Brew", or giving some other measure of progress (preferably a progress bar)