반응형
우분투에서 Ruby 2를 설치하는 방법
테스트 환경
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
필수 패키지 설치
sudo apt-get update
sudo apt-get install -y git curl libssl-dev libreadline-dev zlib1g-dev
rbenv 설치
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
exec $SHELL
ruby-build 플러그인 설치
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
728x90
Ruby 2 설치
rbenv install 2.7.6
$ rbenv install 2.7.6
To follow progress, use 'tail -f /tmp/ruby-build.20221222144042.50871.log' or pass --verbose
Downloading openssl-1.1.1s.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa
Installing openssl-1.1.1s...
Installed openssl-1.1.1s to /root/.rbenv/versions/2.7.6
Downloading ruby-2.7.6.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.6.tar.bz2
Installing ruby-2.7.6...
WARNING: ruby-2.7.6 is nearing its end of life.
It only receives critical security updates, no bug fixes.
Installed ruby-2.7.6 to /root/.rbenv/versions/2.7.6
NOTE: to activate this Ruby version as the new default, run: rbenv global 2.7.6
전역으로 Ruby 2 설정
rbenv global 2.7.6
설치 확인
ruby --version
ln -s /root/.rbenv/shims/ruby /bin/ruby
rbenv 사용법
$ rbenv
rbenv 1.1.2
Usage: rbenv <command> [<args>]
Some useful rbenv commands are:
commands List all available rbenv commands
local Set or show the local application-specific Ruby version
global Set or show the global Ruby version
shell Set or show the shell-specific Ruby version
install Install a Ruby version using ruby-build
uninstall Uninstall a specific Ruby version
rehash Rehash rbenv shims (run this after installing executables)
version Show the current Ruby version and its origin
versions List installed Ruby versions
which Display the full path to an executable
whence List all Ruby versions that contain the given executable
See `rbenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/rbenv/rbenv#readme
rbenv를 통해 Ruby 2를 우분투에 성공적으로 설치하였습니다
참고URL
- ruby latest version : https://rubychangelog.com/versions-latest/
참고: 이 Ruby 버전을 새로운 기본값으로 활성화하려면 다음을 실행하세요: rbenv global 2.7.6
728x90
반응형
'리눅스' 카테고리의 다른 글
HTML 리다이렉션 (0) | 2022.12.29 |
---|---|
[리눅스] Anaconda 설치(conda 명령) (0) | 2022.12.27 |
우분투에서 Samba 서버를 설정하고 구성하는 방법 (0) | 2022.12.16 |
웹 서버에서 리다이렉션(redirect) 설정하는 방법 (0) | 2022.11.30 |
apt/apt-get command (0) | 2022.11.21 |