「Rbenv」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(→‎参照: == Troubleshooting == を追加)
 
(同じ利用者による、間の2版が非表示)
17行目: 17行目:
   
 
rbenv はプラグインシステムで拡張することができ、rbenv の wiki には [https://github.com/sstephenson/rbenv/wiki/Plugins 便利なプラグインのリスト] が記載されています。特に ruby-build プラグインが便利です。{{ic|rbenv install}} コマンドで特定の Ruby バージョンをインストールできるようになります。AUR から {{AUR|ruby-build}} でインストールすることが可能です。
 
rbenv はプラグインシステムで拡張することができ、rbenv の wiki には [https://github.com/sstephenson/rbenv/wiki/Plugins 便利なプラグインのリスト] が記載されています。特に ruby-build プラグインが便利です。{{ic|rbenv install}} コマンドで特定の Ruby バージョンをインストールできるようになります。AUR から {{AUR|ruby-build}} でインストールすることが可能です。
 
== Troubleshooting ==
 
 
=== Ruby 2.3.x ===
 
 
Before compiling, make sure you have all the dependencies needed:
 
 
pacman -S --needed base-devel libffi libyaml openssl zlib
 
 
Installation of Ruby 2.3.x may break down due to openssl version described here:
 
 
* https://stackoverflow.com/questions/44116005/openssl-error-installing-ruby-2-1-x-and-2-3-x-on-archlinux-with-ruby-install-rub
 
 
ossl_ssl.c:465:38: error: ‘CRYPTO_LOCK_SSL_SESSION’ undeclared
 
 
Here is a way how you can make a ruby compile:
 
 
1. [[Install]] the {{Pkg|openssl-1.0}} package first.
 
 
2. Then run:
 
 
PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig \
 
rbenv install 2.3.4
 
 
=== Ruby 2.x.x ===
 
 
Installation of Ruby 2.0.0, 2.1.4, 2.1.6, 2.1.7, 2.2.2 and 2.2.3 may show this error
 
 
ossl_ssl.c:141:27: error: ‘SSLv3_method’ undeclared here (not in a function)
 
 
This can be solved using the patch as described [https://github.com/rbenv/ruby-build/issues/834#issuecomment-160627207 here]
 
 
 <nowiki>curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig rbenv install --patch 2.2.3</nowiki>
 
 
=== Ruby 1.9.3 ===
 
 
Installation of Ruby 1.9.3 may show the same error:
 
 
ossl_ssl.c:116:27: error: ‘SSLv3_method’ undeclared here (not in a function)
 
 
This can be solved by using the patch as described [https://www.reddit.com/r/archlinux/comments/49bw8j/rvm_fails_to_compile_ruby_with_openssl_102g3/ here]
 
 
 <nowiki>curl -fsSL https://gist.githubusercontent.com/anonymous/679228bc324d6fdd3074.txt | rbenv install --patch 1.9.3-p448</nowiki>
 
 
If above was not enough you can install openssl-1.0 and gcc6 and try:
 
 <nowiki>curl -fsSL https://gist.githubusercontent.com/anonymous/679228bc324d6fdd3074.txt | CC=/usr/bin/gcc-6 PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig rbenv install --patch 1.9.3-p551</nowiki>
 
   
 
==参照==
 
==参照==

2022年11月8日 (火) 18:08時点における最新版

関連記事

rbenv (Simple Ruby Version Management) は複数のバージョンの Ruby を簡単に切り替えることができます。シンプルかつ控えめで、一つのツールは一つのことをやるという UNIX の伝統に従っています。

同じ目的を持ったツールとして RVM が存在します。

インストール

AUR から rbenvAUR をインストールできます。

プラグイン

rbenv はプラグインシステムで拡張することができ、rbenv の wiki には 便利なプラグインのリスト が記載されています。特に ruby-build プラグインが便利です。rbenv install コマンドで特定の Ruby バージョンをインストールできるようになります。AUR から ruby-buildAUR でインストールすることが可能です。

参照