Skip to content

Instantly share code, notes, and snippets.

@ahbou
Last active December 15, 2016 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahbou/a6aa66fc8d35e4e6514eca356599e606 to your computer and use it in GitHub Desktop.
Save ahbou/a6aa66fc8d35e4e6514eca356599e606 to your computer and use it in GitHub Desktop.
Managing multiple Rails version with Bundler and rbenv
# make sure homebrew is up to date
brew update
# update ruby version
brew upgrade ruby-build
# install latest stable version
rbenv install 2.3.3
#set version as global
rbenv global 2.3.3
#install bundler for that ruby version
gem install bundler
# create directory
mkdir my-rails-app
# get the latest rails version
gem search rails | grep "^rails "
#add gemfile targetting latest version
echo "source 'https://rubygems.org'" > Gemfile
echo "gem 'rails', '5.0.0.1'" >> Gemfile
#intall Rails version
bundle install
#check that it was installed
bundle exec rails -v
#create the Rails app (overwrite gemfile)
bundle exec rails new . --force --skip-bundle
bundle update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment