LoginSignup
7
7

More than 3 years have passed since last update.

CentOSにrpmbuildからRuby環境を構築する

Last updated at Posted at 2014-10-31

CentOS 7系にRuby 2.7系の環境を構築するニッチな投稿です

環境

  • CentOS 7.8-2003

準備

(必要な方は)
* プロキシの指定方法

rpmbuildの導入と環境構築

yum install rpmdevtools
rpmdev-setuptree

Rubyのインストール

パッケージの準備

yum install readline-devel ncurses-devel gdbm-devel glibc-devel gcc openssl-devel libyaml-devel libffi-devel zlib-devel

ソースのダウンロード

cd ~/rpmbuild/SOURCES
wget https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.gz

specファイルのダウンロード

cd ~/rpmbuild/SPECS
wget -O ruby-2.7.1.spec https://raw.githubusercontent.com/feedforce/ruby-rpm/master/ruby-2.7.spec

specファイル内のバージョンに従ってリネームしている

リビルドとインストール

rpmbuild --clean -bb ruby-2.7.1.spec

yum --nogpgcheck localinstall ~/rpmbuild/RPMS/x86_64/ruby-2.7.1-1.el7.x86_64.rpm

Bundlerもインストール

gem install bundler

参考

  1. 最新のRubyをRPMで入れる - ほとラボ
  2. rpmbuild環境の構築 - Qiita
7
7
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
7
7