Search code examples
ruby-on-railsrubyrbenv

Understanding RBENV: Switching Ruby Versions Locally


After upgrading my Ruby version, I've (as expected) run in to some trouble getting my server up and running with older projects. I'm curious about how to switch Ruby versions locally for a specific project. Rbenv's github page uses $ rbenv local 1.9.3-p327as an example command of how to do this. What I want to know is what the -p327 refers to, what it should be in my case, and if it's even necessary. Can I just run $ rbenv local 2.3.1 for example?

(In my case, I am currently using Ruby -v 2.4.0 want to go back to an earlier version to avoid a Devise Gem error that I can't seem to get past.)


Solution

  • To answer your other question,

    Rbenv's github page uses $ rbenv local 1.9.3-p327 as an example command of how to do this. What I want to know is what the -p327 refers to...

    The old versioning policy for Ruby was MAJOR.MINOR.TEENY-PATCH

    p327 simply refers to patchlevel, which is basically a number that gets incremented for each accepted patch after the increment of a MINOR number. Prior to Ruby 2.1, security fixes did not increment the TEENY version, so some releases specify the patchlevel.