Skip to content

Instantly share code, notes, and snippets.

@faloi
Created June 30, 2017 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faloi/435a972333ceef06ef226848b1c87e48 to your computer and use it in GitHub Desktop.
Save faloi/435a972333ceef06ef226848b1c87e48 to your computer and use it in GitHub Desktop.

Instalar rbenv

rbenv es un gestor de versiones de Ruby, que nos facilitará la instalación y la selección de la versión correspondiente para cada proyecto.

Para instalarlo, basta con ejecutar los siguientes comandos (notar que requieren que git esté instalado):

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build

Una vez instalado, cerrar la terminal, abrir una nueva y comprobar si la instalación fue satisfactoria corriendo el comando rbenv, el cual debería imprimir algo similar a esto:

rbenv 1.0.0-30-g0c7224a
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 all Ruby versions available to rbenv
   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

Instalar Ruby 2.3.1

Una vez instalado rbenv, instalar una versión de Ruby es tan sencillo como correr este comando:

rbenv install 2.3.1

Luego, para comprobar se puede correr el comando ruby -v, que debería arrojar algo parecido a:

ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

Agregar al server como source de gemas

Para no depender de internet, vamos a ejecutar un servidor de gemas en el server. Una vez que esté corriendo, hay que configurar los clientes para que sepan que pueden buscar gemas ahí.

Asumiendo que el servidor tiene la IP 192.168.88.2 y el gem server está corriendo en el puerto 8808, esto se logra con el siguiente comando:

gem sources -a http://192.168.88.2:8808
@edebonis
Copy link

edebonis commented Jul 1, 2017

Luego de hacer :
rbenv install 2.3.1
tuve que hacer un:
sudo apt install ruby

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment