Write the process to build a Ruby environment for people who do not usually use Ruby. I have no plans to write a Ruby program, but I had to build a Ruby environment in order to use an application made by Ruby, but from the perspective of those who write articles that are difficult to understand even if I search and the contents are clearly non-Ruby But it's a weird hit, so I'll write it myself. I'm neither an expert nor anything, so I don't guarantee the correctness of what I write.
All the real experts probably know, but it's sad that they don't hit the search.
gem
.gem
is (probably) inadequate as a package management software (believed to be).gem
and serves as package management software.bundle
and can be called.bundle
and follow the instructions in the text file named Gemfile
under the current directory to install various gems and configure your Ruby environment.Given the prerequisites, to take the Ruby application provided by the gem seriously,
It turns out that it is necessary to use. I'm using Fish Shell, so it contains parts that are different from bash and Zsh users.
#! /usr/bin/env fish
brew install rbenv
echo "status --is-interactive; and source (rbenv init -|psub)" >> $HOME/.config/fish/config.fish
rbenv install 2.7.2
rbenv global 2.7.2
gem install bundler
rbenv rehash
I need rbenv rehash
, but I don't understand why.
Gemfile
under my home directory, write the gem settings there, and run bundler.#! /usr/bin/env fish
echo "\
source 'https://rubygems.org'
gem 'asciidoctor'
gem 'asciidoctor-diagram'
" > $HOME/Gemfile
bundle
rbenv rehash
I need rbenv rehash
as well, but I don't understand why.
I've just written the process by which the application started working, so I'm waiting for supplements, corrections, and criticisms from those who are familiar with it.
Recommended Posts