{"issue":{"created_at":"2011-08-05T14:55:12Z","state":"closed","updated_at":"2011-12-12T04:50:42Z","user":{"gravatar_id":"5b9fe87ec1faa67a4599782930f45ec9","id":2603,"url":"https://api.github.com/users/sstephenson","login":"sstephenson","avatar_url":"https://secure.gravatar.com/avatar/5b9fe87ec1faa67a4599782930f45ec9?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":3,"body":"     -S             Makes Ruby use the PATH environment variable to search for\r\n                    script, unless if its name begins with a slash.  This is\r\n                    used to emulate #! on machines that don't support it, in\r\n                    the following manner:\r\n\r\n                          #! /usr/local/bin/ruby\r\n                          # This line makes the next one a comment in Ruby \\\r\n                            exec /usr/local/bin/ruby -S $0 $*\r\n\r\nWhen you pass the `-S foo` flag to Ruby, it finds `foo` in `$PATH`, then scans the first line of the file to see if it's a Ruby program and re-execs: https://github.com/ruby/ruby/blob/trunk/ruby.c#L1549-1562\r\n\r\nThe Rubinius installer uses this:\r\n\r\n    /Users/sam/.rbenv/versions/1.9.3-preview1/bin/ruby -S rake  -r /private/tmp/ruby-build.10166-13998/rubinius-1.2.4/config.rb -r /private/tmp/ruby-build.10166-13998/rubinius-1.2.4/rakelib/ext_helper.rb -r /private/tmp/ruby-build.10166-13998/rubinius-1.2.4/rakelib/dependency_grapher.rb build:mri\r\n    /Users/sam/.rbenv/versions/1.9.3-preview1/bin/ruby: no Ruby script found in input (LoadError)\r\n    rake aborted!\r\n    Command failed with status (1): [/Users/sam/.rbenv/versions/1.9.3-preview1/...]\r\n\r\nOne workaround would be to change our shims' shebang to point to another shim in our libexec directory with `ruby` in the name.  \r\n\r\nAnother workaround would be for `rbenv-exec` to prepend `$PATH` with the current version's prefix, so that children of any Ruby process will find the actual binaries in the path before our shims. The downside here is that you wouldn't be able to modify `RBENV_VERSION` in a Ruby process to spawn a child with a different version, though I'm not sure that's actually useful.","assignee":null,"id":1351625,"labels":[],"number":14,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"Shims are incompatible with `ruby -S`","html_url":"https://github.com/sstephenson/rbenv/issues/14","closed_at":"2011-08-05T15:14:35Z","url":"https://api.github.com/repos/sstephenson/rbenv/issues/14","milestone":null},"action":"created","comment":{"created_at":"2011-12-12T04:50:42Z","updated_at":"2011-12-12T04:50:42Z","user":{"gravatar_id":"f31cc85ae1f3264b5f5c35dcb280415d","id":4524,"url":"https://api.github.com/users/alsemyonov","login":"alsemyonov","avatar_url":"https://secure.gravatar.com/avatar/f31cc85ae1f3264b5f5c35dcb280415d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Same error occurs with Ruby 1.9.3 and bundler --pre","id":3102091,"url":"https://api.github.com/repos/sstephenson/rbenv/issues/comments/3102091"}}