{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/42060","labels_url":"https://api.github.com/repos/Homebrew/homebrew/issues/42060/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/42060/comments","events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/42060/events","html_url":"https://github.com/Homebrew/homebrew/issues/42060","id":96856999,"number":42060,"title":"Homebrew git script fails to load correct interpreter","user":{"login":"rddesmond","id":7284879,"avatar_url":"https://avatars.githubusercontent.com/u/7284879?v=3","gravatar_id":"","url":"https://api.github.com/users/rddesmond","html_url":"https://github.com/rddesmond","followers_url":"https://api.github.com/users/rddesmond/followers","following_url":"https://api.github.com/users/rddesmond/following{/other_user}","gists_url":"https://api.github.com/users/rddesmond/gists{/gist_id}","starred_url":"https://api.github.com/users/rddesmond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rddesmond/subscriptions","organizations_url":"https://api.github.com/users/rddesmond/orgs","repos_url":"https://api.github.com/users/rddesmond/repos","events_url":"https://api.github.com/users/rddesmond/events{/privacy}","received_events_url":"https://api.github.com/users/rddesmond/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Homebrew/homebrew/labels/user%20configuration","name":"user configuration","color":"0b02e1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-23T16:51:00Z","updated_at":"2015-07-23T19:37:32Z","closed_at":null,"body":"When attempting to brew install --HEAD, the git wrapper script included with homebrew doesn't appear to run against the ruby interpreter.\r\n\r\n```\r\n➜  ~  brew install unoconv --HEAD\r\n==> Cloning https://github.com/dagwieers/unoconv.git\r\nRemoving invalid repository from cache\r\n/usr/local/Library/ENV/4.3/git: line 6: syntax error near unexpected token `('\r\n/usr/local/Library/ENV/4.3/git: line 6: `F = File.basename(__FILE__).freeze'\r\nError: Failed to download resource \"unoconv\"\r\nFailure while executing: git clone --depth 1 --branch master https://github.com/dagwieers/unoconv.git /Library/Caches/Homebrew/unoconv--git\r\n```\r\n\r\nThis is running on Mac OS 10.10.4 with:\r\n```\r\n➜  ~  brew --version\r\n0.9.5\r\n➜  ~  /usr/bin/ruby --version\r\nruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin14.1.0]\r\n```\r\n\r\nI found that I could change the shebang line in `/usr/local/Library/ENV/4.3/git` from `#!/usr/bin/ruby -W0` to `#!/usr/bin/env ruby -W0`, and have it work correctly.  This isn't a portable solution though (since linux's implementation of env doesn't allow multiple options).\r\n\r\nI also found that:\r\n - `/usr/local/Library/ENV/4.3/git --help` works correctly from the zsh shell\r\n - `/usr/bin/ruby /usr/local/Library/ENV/4.3/git  --help` works correctly from the zsh shell"},"comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments/124219935","html_url":"https://github.com/Homebrew/homebrew/issues/42060#issuecomment-124219935","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/42060","id":124219935,"user":{"login":"rddesmond","id":7284879,"avatar_url":"https://avatars.githubusercontent.com/u/7284879?v=3","gravatar_id":"","url":"https://api.github.com/users/rddesmond","html_url":"https://github.com/rddesmond","followers_url":"https://api.github.com/users/rddesmond/followers","following_url":"https://api.github.com/users/rddesmond/following{/other_user}","gists_url":"https://api.github.com/users/rddesmond/gists{/gist_id}","starred_url":"https://api.github.com/users/rddesmond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rddesmond/subscriptions","organizations_url":"https://api.github.com/users/rddesmond/orgs","repos_url":"https://api.github.com/users/rddesmond/repos","events_url":"https://api.github.com/users/rddesmond/events{/privacy}","received_events_url":"https://api.github.com/users/rddesmond/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T19:37:32Z","updated_at":"2015-07-23T19:37:32Z","body":"(That shim is placed by homebrew:\r\n\r\n```\r\n1 #!/usr/bin/env bash\r\n  2 set -e\r\n  3 [ -n \"$RBENV_DEBUG\" ] && set -x\r\n  4\r\n  5 program=\"${0##*/}\"\r\n  6 if [ \"$program\" = \"ruby\" ]; then\r\n  7   for arg; do\r\n  8     case \"$arg\" in\r\n  9     -e* | -- ) break ;;\r\n 10     */* )\r\n 11       if [ -f \"$arg\" ]; then\r\n 12         export RBENV_DIR=\"${arg%/*}\"\r\n 13         break\r\n 14       fi\r\n 15       ;;\r\n 16     esac\r\n 17   done\r\n 18 fi\r\n 19\r\n 20 export RBENV_ROOT=\"/Users/rddesmond/.rbenv\"\r\n 21 exec \"/usr/local/Cellar/rbenv/0.4.0/libexec/rbenv\" exec \"$program\" \"$@\"\r\n```\r\n)"}}