Difference between revisions of "Rbenv"

From ArchWiki
Jump to: navigation, search
(Created a new "plugins" subsection under "installation", and added a link to the rbenv plugins wiki page.)
m (This error can also occur on version 2.2.2)
 
(10 intermediate revisions by 8 users not shown)
Line 1: Line 1:
[[Category:Programming language]]
+
[[Category:Programming languages]]
 +
[[ja:Rbenv]]
 +
{{Related articles start}}
 +
{{Related|RVM}}
 +
{{Related|Chruby}}
 +
{{Related|Ruby}}
 +
{{Related articles end}}
 
[https://github.com/sstephenson/rbenv rbenv] (Simple Ruby Version Management) lets you easily switch between multiple versions of Ruby. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.
 
[https://github.com/sstephenson/rbenv rbenv] (Simple Ruby Version Management) lets you easily switch between multiple versions of Ruby. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.
  
Another tool to be used for the same purpose is [[rvm]].  
+
Another tool to be used for the same purpose is [[RVM]].  
  
==Comparison with RVM==
+
== Installation ==
  
[https://github.com/sstephenson/rbenv/wiki/Why-rbenv%3F From the wiki:]
+
You can install {{AUR|rbenv}} from the [[AUR]].
  
rbenv does...
+
== Plugins ==
* Let you change the global Ruby version on a per-user basis.
+
* Provide support for per-project Ruby versions.
+
* Allow you to override the Ruby version with an environment variable.
+
  
In contrast with rvm, rbenv does not...
+
rbenv can be extended via a plugin system, and the rbenv wiki includes a [https://github.com/sstephenson/rbenv/wiki/Plugins list of useful plugins]. The ruby-build plugin is especially useful, as it allows you to install Ruby versions with the {{ic|rbenv install}} command. You can install {{AUR|ruby-build}} from the AUR.
* Need to be loaded into your shell. Instead, rbenv's shim approach works by adding a directory to your $PATH.
+
* Override shell commands like cd. That's dangerous and error-prone.
+
* Have a configuration file. There's nothing to configure except which version of Ruby you want to use.
+
* Install Ruby. You can build and install Ruby yourself, or use ruby-build to automate the process.
+
* Manage gemsets. Bundler is a better way to manage application dependencies. If you have projects that are not yet using Bundler you can install the rbenv-gemset plugin.
+
* Require changes to Ruby libraries for compatibility. The simplicity of rbenv means as long as it's in your $PATH, nothing else needs to know about it.
+
* Prompt you with warnings when you switch to a project. Instead of executing arbitrary code, rbenv reads just the version name from each project. There's nothing to "trust."
+
  
==Installation==
+
== Troubleshooting ==
  
===Single-user===
+
=== Ruby 2.x.x ===
It is really straightforward; please refer to the application's website.
+
  
===Multi-user===
+
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
A shared installation is an experimental feature. [https://github.com/sstephenson/rbenv/wiki/shared-install-of-rbenv Here] you can read the official documentation.
+
  
[http://lab.hackcoop.com.ar/projects/vps/wiki/Ruby These] instructions were used to install rbenv in an Arch server; although in Spanish, almost for sure you will be able to go through them.
+
  ossl_ssl.c:141:27: error: ‘SSLv3_method’ undeclared here (not in a function)
  
===Plugins===
+
This can be solved using the patch as described [https://github.com/rbenv/ruby-build/issues/834#issuecomment-160627207 here]
rbenv can be extended via a plugin system. The rbenv wiki includes a [https://github.com/sstephenson/rbenv/wiki/Plugins list of useful plugins]. In particular, you may wish to install [https://github.com/sstephenson/ruby-build ruby-build]. Though rbenv allows you to use a particular Ruby version, it does not include any built-in method of installing Ruby executables. ruby-build is a plugin that provides this capability.
+
 
 +
  <nowiki>curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | rbenv install --patch 2.2.3</nowiki>
  
 
==External links==
 
==External links==
 
* [http://rbenv.org/ Official web site]
 
* [http://rbenv.org/ Official web site]

Latest revision as of 12:47, 22 August 2016

Related articles

rbenv (Simple Ruby Version Management) lets you easily switch between multiple versions of Ruby. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.

Another tool to be used for the same purpose is RVM.

Installation

You can install rbenvAUR from the AUR.

Plugins

rbenv can be extended via a plugin system, and the rbenv wiki includes a list of useful plugins. The ruby-build plugin is especially useful, as it allows you to install Ruby versions with the rbenv install command. You can install ruby-buildAUR from the AUR.

Troubleshooting

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 here

 curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | rbenv install --patch 2.2.3

External links