bigblind
bigblind

Reputation: 12867

How to get RUBY_PLATFORM value without Ruby?

I'm trying to automate the installation of dependencies for a project I'm working on. It uses the v8 binary from `https://rubygems.org/downloads/libv8-${V8_VERSION}-x86_64-linux.gem``

That last part of the URL should be the RUBY_PLATFORMvalue for the platform it supports. Where can I find how this constant is set, so I can determine its value without requiring Ruby to be installed?

Upvotes: 4

Views: 766

Answers (1)

Peter Camilleri
Peter Camilleri

Reputation: 1912

After a fair bit of digging, it seems that the RUBY_PLATFORM value you seek is not derived from anything in the host system. Rather it is a string constant contained in the file "rbconfig.rb" in the Ruby install.

Now if you have access to the Ruby files you could search for that file and then the following line of code:

CONFIG["arch"] = "i386-mingw32"

You would of course extract a different string value.

If you can execute ruby then maybe:

ruby -e "puts RUBY_PLATFORM"

but I suspect that is not the case.

Upvotes: 7

Related Questions