質問

I have Passenger configured to support Rails apps in multiple VirtualHosts with differing versions of Ruby. I'd like a secondary way to detect the version of Ruby that is being provided to each app, to make sure that I got the configuration correct.

Is there a quick way to get a running Rails app to tell you what version of Ruby it sees itself running on? It doesn't have to be from the web side: I'm happy to ask the question from the server command-line if that's more straight-forward.

役に立ちましたか?

解決

Set PassengerLogLevel to 2. During spawning of an application, you should see a line that contains this:

>> ruby: ..path-to-ruby-interpreter...

他のヒント

Ruby's Object defines the constant RUBY_VERSION. Check out Object's other RUBY_* constants, too, like RUBY_REVISION, RUBY_RELEASE_DATE, etc.

2.0.0-p353 :007 > Object.constants.grep /RUBY/
=> [:RUBY_VERSION, :RUBY_RELEASE_DATE, :RUBY_PLATFORM, :RUBY_PATCHLEVEL, :RUBY_REVISION, :RUBY_DESCRIPTION, :RUBY_COPYRIGHT, :RUBY_ENGINE, :RUBYGEMS_ACTIVATION_MONITOR]
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top