Skip to content

Instantly share code, notes, and snippets.

@jlollis
Last active May 3, 2019 22:51
Show Gist options
  • Save jlollis/7b24b02bcd4f6fdb2ef2bcd5ead58af5 to your computer and use it in GitHub Desktop.
Save jlollis/7b24b02bcd4f6fdb2ef2bcd5ead58af5 to your computer and use it in GitHub Desktop.
installing an earlier version or rails with rbenv
  1. For legacy projects, check your installed versions of ruby against this list.

  2. If you have a version that will work with the Rails version you need, then proceed to 4, if not go to 3, install an compatible version using rbenv.

  3. After installing a compatible version, switch your local ruby version for your project folder to the relevant one:

rbenv versions
rbenv local 2.4.0
rbenv versions
rbenv rehash
rbenv which irb
rbenv whence rackup
gem search rails | grep "^rails "

  1. Then, navigate to the project folder and locally install the version of Rails you require with this command, using a compatible ruby version.
RBENV_VERSION=2.4.0 rbenv exec gem install rails --version 4.2.11

Build new Rails version:

RBENV_VERSION=2.4.0 rbenv exec rails _4.2.11_ new recipefinder
  1. Navigate to the new folder that contains your rails app and set the local version of ruby:
cd recipe-finder
rbenv local 2.4.0
  1. Start the web server:
bin/rails server
@jlollis
Copy link
Author

jlollis commented May 3, 2019

from Desktop, in WSL bash:

rails _4.2.8_ new recipefinder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment