[LINUX] [Note] How to create a Ruby development environment

How to do if MacOS is Mojave or earlier

Install rbenv and ruby-build

Terminal


$ brew install rbenv ruby-build

Make rbenv available from any directory

Terminal


$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

Note that bash_profile differs depending on whether the Mac OS version is Catalina or earlier than Mojave.

Reflect changes in bash file

Terminal


$ source ~/.bash_profile

Install readline

Terminal


$ brew install readline

realine allows you to input Japanese on the terminal

Make readline available from anywhere

Terminal


$ brew link readline --force

Install Ruby using rbenv

It takes time to process

Terminal


$ RUBY_CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline)"
$ rbenv install 2.5.1

Specify the version used by Ruby

Terminal


$ rbenv global 2.5.1

Load rbenv and reflect the settings

Terminal


$ rbenv rehash

Check Ruby version

Terminal


$ ruby -v

Success if version is displayed

MySQL installation

Terminal


$ brew install [email protected]

MySQL auto-configuration

Set MySQL to start automatically when you start your PC

Terminal


$ mkdir ~/Library/LaunchAgents 
$ ln -sfv /usr/local/opt/mysql\@5.6/*.plist ~/Library/LaunchAgents
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql\@5.6.plist 

Allow MySQL to be operated from anywhere

Terminal


#Allows you to execute mysql commands
$ echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile
#Check if you can type mysql command
$ which mysql
#Success if the following is displayed
/usr/local/opt/[email protected]/bin/mysql

Preparing for Ruby on Rails

Install bundler

Terminal


$ gem install bundler

bundler is for managing gem which is an extension of Rails.

Rails installation

Terminal


$ gem install rails --version='5.2.3'

Reload rbenv

Terminal


$ rbenv rehash

Check if it was introduced

Terminal


$ rails -v

If the version is displayed, the installation is successful.

Recommended Posts

[Note] How to create a Ruby development environment
[Note] How to create a Mac development environment
How to create a Python virtual environment (venv)
[Development environment] How to create a data set close to the production DB
How to build a development environment for TensorFlow (1.0.0) (Mac)
How to create a Conda package
How to create a virtual bridge
How to create a Dockerfile (basic)
How to create a config file
A note on how to load a virtual environment in PyCharm
How to build a python2.7 series development environment with Vagrant
How to build a sphinx translation environment
How to create a git clone folder
How to create an NVIDIA Docker environment
How to prepare Python development environment [Mac]
How to create a repository from media
How to share a virtual environment [About requirements.txt]
How to create a function object from a string
How to create a JSON file in Python
How to create a shortcut command for LINUX
How to use pip3 under proxy environment Note
How to create a Kivy 1-line input box
How to set up a local development server
How to create a multi-platform app with kivy
Create a Python environment
How to create a Rest Api in Django
Create a Python virtual development environment on Windows
I want to create a nice Python development environment for my new Mac
How to quickly create a morphological analysis environment using Elasticsearch on macOS Sierra
How to run a Django application on a Docker container (development and production environment)
Install and set Jupyter Notebook to create a study note creation environment [Mac]
[Python] How to create a local web server environment with SimpleHTTPServer and CGIHTTPServer
Read the Python-Markdown source: How to create a parser
A memo to create a virtual environment (venv) before Django
How to set up a Python environment using pyenv
How to create a submenu with the [Blender] plugin
Repairing a broken development environment with mavericks migration (Note)
[Go] How to create a custom error for Sentry
How to build a Django (python) environment on docker
I want to easily build a model-based development environment
How to create a local repository for Linux OS
How to create a simple TCP server / client script
[Python] How to create a 2D histogram with Matplotlib
How to build a Python environment on amazon linux 2
Create a Python development environment on OS X Lion
How to create a kubernetes pod from python code
How to call a function
[Note] How to use virtualenv
How to hack a terminal
How to create a Python 3.6.0 environment by putting pyenv on Amazon Linux and Ubuntu
How to use Docker to containerize your application and how to use Docker Compose to run your application in a development environment
[It's not too late to learn Python from 2020] Part 2 Let's create a Python development environment
A memo on how to easily prepare a Linux exercise environment
How to build a new python virtual environment on Ubuntu
Create a VS Code + Docker development environment on a Linux VM
How to transpose a 2D array using only python [Note]
Create a GO development environment with [Mac OS Big Sur]
[Python Kivy] How to create a simple pop up window
How to substitute a numerical value for a partial match (Note 1)
Create a simple Python development environment with VSCode & Docker Desktop
How to create a SAS token for Azure IoT Hub