I have an existing Ruby on Rails project. How do I find out which version of Ruby is originally used for the application?
Edit: To sum up this thread: If there are no ruby-version specific gems, every Ruby should work. All your posts were helpful - Thanks.
If no version-specific gems are in use, I'm not sure it's possible to determine the exact ruby version used during development. In any case, the app may work fine against several versions, depending on the features it has.
If the app has comprehensive tests, you could just work back to find the latest version for which all the tests pass.
Checking the minimum version of Ruby compatible with the Rails version used would also help to narrow the field.
Some people use rvm to manage gemsets in their projects, in this case .rvmrc contains this information, like: "ruby-1.9.2-p180@projectname"
The answers above are split between two cases:
For #2, the answers above cover it pretty much. You guys are lucky.
For #1, its more of an archealogical expedition. I believe the OP is in that situation and I was in a similar situation today.
Looking at the gem versions is probably the best way to do it.
Here are a few clues that can be used, for everyone's reference. (For the benefit of those who stumble upon this article in the future):
In General if you read through the old "migration guides from 1.8.7 to 1.9" which lists the differences, you can use those differences to help you find clues. See:
This SO question:
What is the difference between Ruby 1.8 and Ruby 1.9
and this airbnb blog post:
http://nerds.airbnb.com/upgrading-from-ree-187-to-ruby-193/
Good luck!
(1): "Using this gem in Ruby 1.9 is useless and does not make any sense! System Timer is trying to work around some limitation of the "green thread" model used in Ruby 1.8 (MRI). See http://ph7spot.com/musings/system-timer for more details." A drop-in replacement for SystemTimer is timeout.rb from Ruby core.Oct 21, 2011" source: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=systemtimer%20gem
For me, I logged into the server where the project was hosted to see what version was installed there: ruby --version
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With