sportngin / brew-gem

Install gems as homebrew formulas
MIT License
195 stars 22 forks source link

ENV vars not being passed in #6

Closed NickLaMuro closed 9 years ago

NickLaMuro commented 10 years ago

I have noticed many scenarios where the flag mentioned here https://github.com/sportngin/brew-gem#troubleshooting is not getting passed in when running brew gem upgrade or brew gem install. I have gotten around it by doing the HOMEBREW_DEBUG=1 in the following manner:

$> HOMEBREW_DEBUG=1 brew gem install some_gem
/usr/local/Library/brew.rb (Formulary::FromPathLoader): loading /usr/local/Cellar/some_gem.rb
==> Fetching some_gem from gem source
==> gem install /Library/Caches/Homebrew/some_gem-0.0.1.gem --no-rdoc --no-ri --no-user-install --install-dir /usr/local/Cellar/some_gem/0.0.1 --bindir /usr/local/Cellar/some_gem/0.0.1/bin

Gem files will remain installed in /usr/local/Cellar/some_gem/0.0.1/gems/nokogiri-1.6.2.1 for inspection.
Results logged to /usr/local/Cellar/some_gem/0.0.1/gems/nokogiri-1.6.2.1/ext/nokogiri/gem_make.out
/usr/local/Library/Homebrew/formula.rb:611:in `system'
BuildError: Failed executing: gem install /Library/Caches/Homebrew/some_gem-0.0.1.gem --no-rdoc --no-ri --no-user-install --install-dir /usr/local/Cellar/some_gem/0.0.1 --bindir /usr/local/Cellar/some_gem/0.0.1/bin
1. raise
2. ignore
3. backtrace
4. irb
5. shell
Choose an action: 5
When you exit this shell, you will return to the menu.
bash-3.2$ ADD_SOME_ENV_FLAGS=1 gem install /Library/Caches/Homebrew/some_gem-0.0.1.gem --no-rdoc --no-ri --no-user-install --install-dir /usr/local/Cellar/some_gem/0.0.1 --bindir /usr/local/Cellar/some_gem/0.0.1/bin
Successfully installed some_gem-0.0.1
1 gems installed
nicklamuro@Nicks-Macbook-Air: some_gem-nmgD $ exit
exit
1. raise
2. ignore
3. backtrace
4. irb
5. shell
Choose an action: 2
Fixing /usr/local/Cellar/some_gem/0.0.1/bin/some_gem permissions from 644 to 555
🍺  /usr/local/Cellar/some_gem/0.0.1: 1230 files, 24M, built in 6.2 minutes
$>

The key steps here is pop into a shell (option 5) and execute the failing command, then exit the subshell, and choose "ignore" (option 2) and it should continue where it left off.

This really should be fixed, but for now this is the workaround.

anfleene commented 10 years ago

Are you proposing a solution to this? Its not clear to me what the actual issue is. I agree that it's annoying that it swallows the error. But I just sort of assumed as you found we could run it in debug mode to figure it out.

anfleene commented 9 years ago

@NickLaMuro Lets close this out unless there's something we want to fix here.