Forum: JRuby Detect on which OS jruby is running

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B63501aa235ec0a016402b3d78543088?d=identicon&s=25 Andrea Fazzi (remogatto)
on 2009-03-31 21:53
(Received via mailing list)
Hi all,

I'd like to know if there is a safe and standard way to detect on which
OS jruby is running. The RUBY_PLATFORM constant doesn't seem to be very
useful in this case.

Thanks in advance.
Andrea



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Ba2f834cba243e6d678c06626d544918?d=identicon&s=25 Vladimir Sizikov (Guest)
on 2009-03-31 21:59
(Received via mailing list)
Hi Anrdea,

Sure, use rbconfig:

jruby -e "require 'rbconfig'; p Config::CONFIG['target_os']"

It will print out the OS name, e.g.:
"mswin"

Thanks,
  --Vladimir

On Tue, Mar 31, 2009 at 9:52 PM, Andrea Fazzi <andrea.fazzi@alcacoop.it>
wrote:
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
E0737dd2ec32558e989ff48536039f73?d=identicon&s=25 Adam Sroka (Guest)
on 2009-03-31 22:13
(Received via mailing list)
Or you could:

jruby -e "include Java; puts java.lang.System.getProperty('os.name')"

On Tue, Mar 31, 2009 at 12:57 PM, Vladimir Sizikov <vsizikov@gmail.com>
wrote:
>  --Vladimir
>>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-03-31 23:33
(Received via mailing list)
Adam Sroka wrote:
> Or you could:
>
> jruby -e "include Java; puts java.lang.System.getProperty('os.name')"

The difference being that for the rbconfig version we try to normalize
the names to what CRuby reports...

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
B63501aa235ec0a016402b3d78543088?d=identicon&s=25 Andrea Fazzi (remogatto)
on 2009-03-31 23:56
(Received via mailing list)
Il giorno mar, 31/03/2009 alle 16.33 -0500, Charles Oliver Nutter ha
scritto:
> Adam Sroka wrote:
> > Or you could:
> >
> > jruby -e "include Java; puts
> java.lang.System.getProperty('os.name')"
>
> The difference being that for the rbconfig version we try to
> normalize
> the names to what CRuby reports...

Thanks for the suggestions. There was a bug in the OS detection that
prevented to run ffi-opengl with jruby. Now it should be fixed as commit
645184 on github[1].

Andrea

[1] - http://github.com/remogatto/ffi-opengl/tree/master



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.