Determine ruby version from within Rails

后端 未结 4 2019
时光取名叫无心
时光取名叫无心 2020-12-07 19:46

Is there a way to determine what version of Ruby is running from within Rails (either on the web or through script/console)? I have Ruby 1.8.6 installed but I\'

4条回答
  •  青春惊慌失措
    2020-12-07 20:27

    In addition to the RUBY_VERSION constant and friends you may also want to check out Config::CONFIG. This hash contains not only the version numbers but also a ton of other useful runtime information, like the path to the binary, the hostname, ...

提交回复
热议问题