Ruby Gets Confused With The Java 'bundle' symlink on Mac OS X 10.6
Created by: ghost
We might fix this ourselves but just wanted to get it documented in case we didn't have time.
RSpec is running Ruby directly and calling it with the "-S" option.
The problem arises when you have JAVA_HOME in your PATH on Mac OS X. If JAVA_HOME comes before Ruby's gem path (as it always would if you're setting JAVA_HOME and using RVM), when Ruby searches the PATH for 'bundle' it hits a problem.
Unfortunately there's a symlink located at /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home called 'bundle'
Ruby sees this symlink, attempts to execute it and throws: ruby: Is a directory - /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bundle (Errno::EISDIR)
Whereas running the command without "ruby -S" (and allowing the OS to deal with executables and paths) works with no problems (ie 'bundle exec rspec' rather than 'ruby -S bundle exec rspec').