Ruby on Rails: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(20 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
sudo apt install --yes autoconf automake bison build-essential curl git libgdbm-dev libncurses5-dev | |||
sudo apt install --yes libffi-dev libsqlite3-dev libtool libyaml-dev sqlite3 libreadline-dev zlib1g-dev | |||
==Ruby » RBENV== | |||
<syntaxhighlight lang="bash"> | |||
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash | |||
</syntaxhighlight> | |||
===Ruby » RBENV » Bashrc=== | |||
---- | |||
<syntaxhighlight lang="bash"> | |||
if [[ -e ${HOME}/.bashrc ]]&&[[ -s ${HOME}/.bashrc ]]&& | |||
[[ "$(grep -c '${HOME}/.rbenv/bin/rbenv' ${HOME}/.bashrc)" == 0 ]];then | |||
tee -a ${HOME}/.bashrc >/dev/null <<'EOF' | |||
# rbenv config | |||
if [[ ! "${PATH}" =~ "${HOME}/.rbenv/bin:" ]]&& | |||
[[ -x "${HOME}/.rbenv/bin/rbenv" ]];then | |||
export PATH=${HOME}/.rbenv/bin:${PATH} | |||
eval "$(rbenv init -)" | |||
fi | |||
EOF | |||
fi | |||
</syntaxhighlight> | |||
===Ruby » RBENV » Profiles=== | |||
---- | |||
<syntaxhighlight lang="bash"> | |||
for PROFILE_NAME in .bash_profile .bashrc;do | |||
if [[ -e ${HOME}/${PROFILE_NAME} ]]&&[[ -s ${HOME}/${PROFILE_NAME} ]]&& | |||
[[ "$(grep -c '${HOME}/.rbenv/bin/rbenv' ${HOME}/${PROFILE_NAME})" == 0 ]];then | |||
tee -a ${HOME}/${PROFILE_NAME} >/dev/null <<'EOF' | |||
# rbenv config | |||
if [[ ! "${PATH}" =~ "${HOME}/.rbenv/bin:" ]]&& | |||
[[ -x "${HOME}/.rbenv/bin/rbenv" ]];then | |||
export PATH=${HOME}/.rbenv/bin:${PATH} | |||
eval "$(rbenv init -)" | |||
fi | |||
EOF | |||
fi | |||
done | |||
</syntaxhighlight> | |||
===Ruby » RBENV » TruffleRuby=== | |||
<syntaxhighlight lang="bash"> | |||
rbenv install --list |grep graalvm | |||
rbenv install --list-all|grep graalvm | |||
du -sh ~/.rbenv/versions/truffleruby* | |||
rbenv install truffleruby+graalvm-22.3.1 | |||
</syntaxhighlight> | |||
==Ruby » RVM== | ==Ruby » RVM== | ||
< | <syntaxhighlight lang="bash"> | ||
sudo apt install gnupg2 | sudo apt install gnupg2 | ||
gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | ||
curl -sSL https://get.rvm.io | bash -s stable | curl -sSL https://get.rvm.io | bash -s stable | ||
</ | </syntaxhighlight> | ||
===Ruby » RVM » Profile=== | ===Ruby » RVM » Profile=== | ||
---- | ---- | ||
< | <syntaxhighlight lang="bash"> | ||
# rvm path setting | |||
if [[ -e ${HOME}/.profile ]]&&[[ -s ${HOME}/.profile ]]&& | |||
[[ "$(grep -c '${HOME}/.rvm/bin/rvm' ${HOME}/.profile)" == 0 ]];then | |||
tee -a ${HOME}/.profile >/dev/null <<'EOF' | |||
# rvm path setting | |||
if [[ ! "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&& | |||
[[ -x "${HOME}/.rvm/bin/rvm" ]];then | |||
export PATH=${PATH}:${HOME}/.rvm/bin | |||
fi | |||
EOF | |||
fi | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | |||
# rvm script loading | |||
if [[ -e ${HOME}/.profile ]]&&[[ -s ${HOME}/.profile ]]&& | if [[ -e ${HOME}/.profile ]]&&[[ -s ${HOME}/.profile ]]&& | ||
[[ "$(grep -c '${HOME}/.rvm/scripts/rvm' ${HOME}/.profile)" == 0 ]];then | [[ "$(grep -c '${HOME}/.rvm/scripts/rvm' ${HOME}/.profile)" == 0 ]];then | ||
tee -a ${HOME}/.profile >/dev/null <<'EOF' | tee -a ${HOME}/.profile >/dev/null <<'EOF' | ||
# rvm | # rvm script loading | ||
if [[ | if [[ "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&& | ||
[[ -x "${HOME}/.rvm/scripts/rvm" ]];then | [[ -x "${HOME}/.rvm/scripts/rvm" ]];then | ||
source ${HOME}/.rvm/scripts/rvm | source ${HOME}/.rvm/scripts/rvm | ||
fi | fi | ||
EOF | EOF | ||
fi | fi | ||
</ | </syntaxhighlight> | ||
===Ruby » RVM » Profiles=== | ===Ruby » RVM » Profiles=== | ||
---- | ---- | ||
< | <syntaxhighlight lang="bash"> | ||
# rvm path setting | # rvm path setting | ||
for PROFILE_NAME in .bashrc .mkshrc .profile .zshrc;do | for PROFILE_NAME in .bashrc .mkshrc .profile .zshrc;do | ||
Line 37: | Line 108: | ||
[[ -x "${HOME}/.rvm/bin/rvm" ]];then | [[ -x "${HOME}/.rvm/bin/rvm" ]];then | ||
export PATH=${HOME}/.rvm/bin | export PATH=${PATH}:${HOME}/.rvm/bin | ||
fi | fi | ||
EOF | EOF | ||
fi | fi | ||
done | done | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight lang="bash"> | ||
# rvm script loading | # rvm script loading | ||
for PROFILE_NAME in .bash_profile .profile .zlogin;do | for PROFILE_NAME in .bash_profile .profile .zlogin;do | ||
Line 60: | Line 131: | ||
fi | fi | ||
done | done | ||
</ | </syntaxhighlight> | ||
==Knowledge== | |||
{| | |||
|valign="top"| | |||
type rbenv | |||
rbenv versions | |||
== | |valign="top"| | ||
rbenv install -l | |||
rbenv install -L | |||
|valign="top"| | |||
rbenv install --list | |||
rbenv install --list-all | |||
|- | |||
|colspan="3"| | |||
---- | |||
|- | |||
|valign="top"| | |||
rbenv version | |||
rbenv install 3.2.1 | |||
|valign="top"| | |||
rbenv versions | |||
rbenv local 3.2.1 | |||
|valign="top"| | |||
rbenv which irb | |||
rbenv global 3.2.1 | |||
= | |- | ||
|colspan="3"| | |||
---- | ---- | ||
|- | |||
|valign="top"| | |||
gem env home | |||
rm -rf "$(rbenv root)" | |||
gem install puma -v 4.3.5 | |||
gem install rails -v 6.0.3.1 | |||
|valign="top"| | |||
mkdir log | |||
bundle install | |||
rails s -p 3001 | |||
|valign="top"| | |||
|} | |||
==References== | ==References== | ||
Line 91: | Line 188: | ||
* [https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-22-04 Install Ruby on Rails with rbenv] | * [https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-22-04 Install Ruby on Rails with rbenv] | ||
* [https://guides.rubyonrails.org/configuring.html Configuring Rails Applications] | * [https://guides.rubyonrails.org/configuring.html Configuring Rails Applications] | ||
* [https://reinteractive.com/articles/Rails-Configuration-Files Rails Configuration Files] | * [https://reinteractive.com/articles/Rails-Configuration-Files Rails Configuration Files] | ||
* [https://github.com/rbenv/rbenv-installer rbenv Installer] | * [https://github.com/rbenv/rbenv-installer rbenv » Installer] | ||
* [[JQ Tool]] | * [[JQ Tool]] | ||
* [https://github.com/rbenv/rbenv rbenv] | * [https://github.com/rbenv/rbenv rbenv] | ||
* [[TMux]] | * [[TMux]] | ||
* [[Bash]] | * [[Bash]] | ||
* [https://rvm.io/ rvm] | |||
| valign="top" | | | valign="top" | | ||
* [https://rvm.io/rubies/removing rvm » Removing] | |||
* [https://stackoverflow.com/questions/3950260/ rvm » Uninstall] | |||
* [[PyEnv]] | |||
| valign="top" | | | valign="top" | |
Latest revision as of 09:25, 2 June 2024
sudo apt install --yes autoconf automake bison build-essential curl git libgdbm-dev libncurses5-dev sudo apt install --yes libffi-dev libsqlite3-dev libtool libyaml-dev sqlite3 libreadline-dev zlib1g-dev
Ruby » RBENV
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
Ruby » RBENV » Bashrc
if [[ -e ${HOME}/.bashrc ]]&&[[ -s ${HOME}/.bashrc ]]&&
[[ "$(grep -c '${HOME}/.rbenv/bin/rbenv' ${HOME}/.bashrc)" == 0 ]];then
tee -a ${HOME}/.bashrc >/dev/null <<'EOF'
# rbenv config
if [[ ! "${PATH}" =~ "${HOME}/.rbenv/bin:" ]]&&
[[ -x "${HOME}/.rbenv/bin/rbenv" ]];then
export PATH=${HOME}/.rbenv/bin:${PATH}
eval "$(rbenv init -)"
fi
EOF
fi
Ruby » RBENV » Profiles
for PROFILE_NAME in .bash_profile .bashrc;do
if [[ -e ${HOME}/${PROFILE_NAME} ]]&&[[ -s ${HOME}/${PROFILE_NAME} ]]&&
[[ "$(grep -c '${HOME}/.rbenv/bin/rbenv' ${HOME}/${PROFILE_NAME})" == 0 ]];then
tee -a ${HOME}/${PROFILE_NAME} >/dev/null <<'EOF'
# rbenv config
if [[ ! "${PATH}" =~ "${HOME}/.rbenv/bin:" ]]&&
[[ -x "${HOME}/.rbenv/bin/rbenv" ]];then
export PATH=${HOME}/.rbenv/bin:${PATH}
eval "$(rbenv init -)"
fi
EOF
fi
done
Ruby » RBENV » TruffleRuby
rbenv install --list |grep graalvm
rbenv install --list-all|grep graalvm
du -sh ~/.rbenv/versions/truffleruby*
rbenv install truffleruby+graalvm-22.3.1
Ruby » RVM
sudo apt install gnupg2
gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
Ruby » RVM » Profile
# rvm path setting
if [[ -e ${HOME}/.profile ]]&&[[ -s ${HOME}/.profile ]]&&
[[ "$(grep -c '${HOME}/.rvm/bin/rvm' ${HOME}/.profile)" == 0 ]];then
tee -a ${HOME}/.profile >/dev/null <<'EOF'
# rvm path setting
if [[ ! "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&&
[[ -x "${HOME}/.rvm/bin/rvm" ]];then
export PATH=${PATH}:${HOME}/.rvm/bin
fi
EOF
fi
# rvm script loading
if [[ -e ${HOME}/.profile ]]&&[[ -s ${HOME}/.profile ]]&&
[[ "$(grep -c '${HOME}/.rvm/scripts/rvm' ${HOME}/.profile)" == 0 ]];then
tee -a ${HOME}/.profile >/dev/null <<'EOF'
# rvm script loading
if [[ "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&&
[[ -x "${HOME}/.rvm/scripts/rvm" ]];then
source ${HOME}/.rvm/scripts/rvm
fi
EOF
fi
Ruby » RVM » Profiles
# rvm path setting
for PROFILE_NAME in .bashrc .mkshrc .profile .zshrc;do
if [[ -e ${HOME}/${PROFILE_NAME} ]]&&[[ -s ${HOME}/${PROFILE_NAME} ]]&&
[[ "$(grep -c '${HOME}/.rvm/bin/rvm' ${HOME}/${PROFILE_NAME})" == 0 ]];then
tee -a ${HOME}/${PROFILE_NAME} >/dev/null <<'EOF'
# rvm path setting
if [[ ! "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&&
[[ -x "${HOME}/.rvm/bin/rvm" ]];then
export PATH=${PATH}:${HOME}/.rvm/bin
fi
EOF
fi
done
# rvm script loading
for PROFILE_NAME in .bash_profile .profile .zlogin;do
if [[ -e ${HOME}/${PROFILE_NAME} ]]&&[[ -s ${HOME}/${PROFILE_NAME} ]]&&
[[ "$(grep -c '${HOME}/.rvm/scripts/rvm' ${HOME}/${PROFILE_NAME})" == 0 ]];then
tee -a ${HOME}/${PROFILE_NAME} >/dev/null <<'EOF'
# rvm script loading
if [[ "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&&
[[ -x "${HOME}/.rvm/scripts/rvm" ]];then
source ${HOME}/.rvm/scripts/rvm
fi
EOF
fi
done
Knowledge
type rbenv rbenv versions |
rbenv install -l rbenv install -L |
rbenv install --list rbenv install --list-all |
| ||
rbenv version rbenv install 3.2.1 |
rbenv versions rbenv local 3.2.1 |
rbenv which irb rbenv global 3.2.1 |
| ||
gem env home rm -rf "$(rbenv root)" gem install puma -v 4.3.5 gem install rails -v 6.0.3.1 |
mkdir log bundle install rails s -p 3001 |
References
| ||