sportngin / brew-gem

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

Use homebrew variables for binary path instead of hardcoding #33

Closed paulhybryant closed 7 years ago

paulhybryant commented 7 years ago

I didn't install homebrew in /usr/local/

So the following line causes failure when installing rubybindir = '<%= use_homebrew_ruby ? "/usr/local/bin" : "/usr/bin" %>'

nicksieger commented 7 years ago

@paulhybryant Thanks for reporting this. Can you try installing with brew install brew-gem --HEAD and see if the fix works for you?

paulhybryant commented 7 years ago

no, this is the error:

(erb):40:in expand_formula': uninitialized constant Brew::Gem::CLI::HOMEBREW_PREFIX (NameError) from /usr/local/Cellar/ruby/2.3.1_2/lib/ruby/2.3.0/erb.rb:864:ineval' from /usr/local/Cellar/ruby/2.3.1_2/lib/ruby/2.3.0/erb.rb:864:in result' from /usr/local/lib/brew/gem/cli.rb:49:inexpand_formula' from /usr/local/lib/brew/gem/cli.rb:56:in block in with_temp_formula' from /usr/local/lib/brew/gem/cli.rb:55:inopen' from /usr/local/lib/brew/gem/cli.rb:55:in with_temp_formula' from /usr/local/lib/brew/gem/cli.rb:76:inrun' from /usr/local/bin/brew-gem:7:in `

'

nicksieger commented 7 years ago

Ah, right. brew-gem gets launched by Homebrew rather than loaded inside of it. I think the fix should be to replace HOMEBREW_PREFIX with either brew --prefix or ENV['HOMEBREW_PREFIX']. I'll see which one works best.

nicksieger commented 7 years ago

@paulhybryant try the most recent master. Should work better now.

paulhybryant commented 7 years ago

yeah that works. Thanks @nicksieger

paulhybryant commented 6 years ago

This seems still only available in HEAD, not in a release?