0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

install rbenv/ruby systemwide on RockyLinux 9.0

Last updated at Posted at 2024-10-03

TL;DR

  • require libyaml-devel

install dnf packages

su -
dnf install git
for ruby-build
dnf install autoconf gcc patch bzip2 openssl-devel libffi-devel readline zlib-devel gdbm ncurses-devel tar perl-FindBin

libyaml-devel(RHEL 9系)

dnf config-manager --set-enabled crb
dnf install libyaml-devel

libyaml-devel(RHEL 8系)

dnf config-manager --set-enabled powertools
dnf install libyaml-devel

rbenv

proxy(必要な人のみ)

git config --global http.https://github.com/.proxy http://server:port

install

cd /usr/local

git clone https://github.com/rbenv/rbenv.git rbenv
git clone https://github.com/rbenv/ruby-build.git rbenv/plugins/ruby-build
/etc/profile.d/rbenv.sh
export RBENV_ROOT="/usr/local/rbenv" 
export PATH="$RBENV_ROOT/bin:$PATH" 
eval "$(rbenv init - --no-rehash)" 

check

exec -l $SHELL
rbenv -v

rustc(YJIT使いたい人のみ)

prepare

mkdir -p /usr/local/rust && cd /usr/local/rust/

export RUSTUP_HOME=/usr/local/rust
export CARGO_HOME=/usr/local/rust

proxy(必要な人のみ)

export HTTP_PROXY=http://server:port
export HTTPS_PROXY=$HTTP_PROXY

install

no-proxy
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
with-proxy
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -x http://server:proxy | sh

特に拘りがなければ1) Proceed with standard installation (default - just press enter)を選ぶ

post-install

/usr/local/bin/rustc
#!/bin/sh

RUSTUP_HOME=/usr/local/rust exec /usr/local/rust/bin/${0##*/} "$@"

実行権限を付ける

chmod 755 /usr/local/bin/rustc

他のrustc関連実行ファイルにもパスを通しておく

cd /usr/local/bin/
ln -s /usr/local/rust/bin/* ./

rustcだけは失敗するが、想定通り
ln: シンボリックリンク './rustc' の作成に失敗しました: ファイルが存在します

check

exec -l $SHELL
rustc -V

ruby

check

rbenv install -l

ここで出てくるものから選ぶのがおすすめ

install

rbenv install 3.4.1
rbenv versions
rbenv global 3.4.1

check

ruby -v

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?