Setting Up a Ruby on Rails Environment on macOS

2017-03-26 11:58 (8 years ago) ytyng

Let's install rbenv using git clone instead of apt or brew.

$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

$ . ~/.bashrc

$ rbenv install -l
$ rbenv install 2.4.1

# After the installation is complete, restart the terminal or reload .bashrc

$ ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

$ cd ~/.workspace/
$ gem install rails

$ rails --version
Rails 5.0.2

$ rails new ytyng-tools

$ cd ytyng-tools
$ rbenv local 2.4.1

$ rails s




Currently unrated
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.

Archive

2025
2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011