Closed tubbo closed 11 years ago
The git-tracker
script installed by Homebrew uses the #!/usr/bin/ruby
shebang line. On modern OS X that is typically some flavor of Ruby 1.8.x. The hash syntax referenced in that error is only valid for Ruby 1.9+. So that is why you're seeing the error.
The real WTF is why the git-tracker
script is running in the context of your app's Gemfile
. As it turns out, Bundler pollutes several ENV
variables, including RUBYOPT
, BUNDLE_GEMFILE
, etc. and those are propagated subshells.
I believe a fix for your tooling would be to execute your subshells like so:
# rain/lib/rain/git_tools.rb#86
def run_cmd(cmd)
puts "executing... #{cmd}"
Bundler.with_clean_env do
%x(#{cmd}) unless ENV['RAILS_ENV'] == "test"
end
end
It's not pretty, but I think that should resolve the issue. Please let me know what you find!
Oh, and @alindeman just told me about Bundler.clean_system
and Bundler.clean_exec
, so you could use one of those too, depending on your needs.
Hmm, I'll give that a shot. Seems like it would prevent a bunch of other problems down the line too. Thanks for the tip!
I've installed this awesome plugin with Homebrew, and I now have a globally-available command named
git-tracker
. Pretty cool!The only time I ever find fault with it is when I'm using
git
inside other programs or plugins, like a Thor script that executes shell commands...Here's an example output from when I try to run Git commands inside another Ruby (using Thor) process:
Not sure if you guys had to deal with it in any other capacity, or if there was a way I should be calling Git commands in my deployment tool that would mitigate this issue?