This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 228585 - RbConfig::CONFIG['ruby_install_name'] returns "jruby.bat"
Summary: RbConfig::CONFIG['ruby_install_name'] returns "jruby.bat"
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Rake (show other bugs)
Version: 7.3
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: issues@ruby
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-16 00:18 UTC by brucetesar
Modified: 2013-04-20 02:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description brucetesar 2013-04-16 00:18:43 UTC
I am using the new "Ruby and Rails" plugin (ver. 0.111) with NetBeans 7.3. Within NetBeans, RbConfig::CONFIG['ruby_install_name'] returns the value "jruby.bat", instead of the correct value "jruby". As a consequence, when certain rake tasks are executed, the dreaded "jruby.bat.exe" call is made. This happens both with the built-in JRuby 1.7.3, and with an external, independently installed JRuby 1.7.3. When I call the external JRuby's own IRB (outside of NetBeans), RbConfig::CONFIG['ruby_install_name'] returns the expected value "jruby". Calling IRB within NetBeans (right-click on an open ruby project) using the very same jruby installation results in RbConfig::CONFIG['ruby_install_name'] returning "jruby.bat", so it appears that the NetBeans setup is modifying the value.
Comment 1 enebo 2013-04-16 15:27:27 UTC
Thanks for reporting this.  I think I have a workaround and possibly you might help find the actual solution.  In JRuby itself, the code for that config value is to call this method:

    public static String jrubyScript() {
        return SafePropertyAccessor.getProperty("jruby.script", "jruby").replace('\\', '/');
    }

So if you can find the script with launches Netbeans (I don't know offhand) then you can add -Djruby.script=jruby.exe and see if things work as expected.  I am hoping somewhere in the install Netbeans is adding this as part of the Ruby module support and it is not hard-coded into source.

This also probably has another issue which is in our Ruby Netbeans source which is that we must be blindly trying to execute without knowing whether that executable exists.  One extra stat() would probably be worth not trying to launch a nonsense-named binary and throwing an error instead.
Comment 2 brucetesar 2013-04-20 02:19:38 UTC
The first things I've tried have not worked. I tried adding "-J-Djruby.script=jruby.exe" to the command line with netbeans.exe directly, and from within NetBeans still get "jruby.bat" for RbConfig::CONFIG['ruby_install_name'].
I also tried editing <netbeans-install>\etc\netbeans.conf and adding "-J-Djruby.script=jruby.exe" to the end of the string for netbeans_default_options. That had no effect either.