I love having the latest versions of Perl, Python, and Ruby at my disposal. For some time now I've been managing my Perl installations with perlbrew, my Python installations with pythonbrew, and my Ruby installations with rvm. They all work fine and I continue to manage my desktop machine this way.
But a while back, I tried rbenv on my laptop. It worked great! Just clone the repositories
$ git clone git://github.com/sstephenson/rbenv.git .rbenv $ git clone git://github.com/sstephenson/ruby-build.git \ ~/.rbenv/plugins/ruby-build
initialize in your shell
# Enable rbenv export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"
and install one or more rubies!
$ rbenv install 2.0.0-p195 ... $ rbenv rehash $ rbenv global 2.0.0-p195 $ ruby -v ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]
To update, just pull the build repo
$ cd .rbenv/plugins/ruby-build/ $ git pull
Now if there's a newer one, you can install it!
$ rbenv install 2.0.0-p247 Downloading ruby-2.0.0-p247.tar.gz... -> ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz Installing ruby-2.0.0-p247... Installed ruby-2.0.0-p247 to /home/tim/.rbenv/versions/2.0.0-p247 $ rbenv rehash $ rbenv global 2.0.0-p247 $ ruby -v ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
Really nice!
Turns out I'm not the only admirer. At YAPC::NA in Austin, I saw Tokuhiro Matsuno talk about plenv. Again, install
$ git clone git://github.com/tokuhirom/plenv.git ~/.plenv/ $ git clone git://github.com/tokuhirom/Perl-Build.git \ ~/.plenv/plugins/perl-build/
enable
# Enable plenv export PATH="$HOME/.plenv/bin:$PATH" eval "$(plenv init -)"
and use
$ plenv install 5.18.0 ... $ plenv rehash $ plenv global 5.18.0 $ perl -E 'say "hello $]"' hello 5.018000
Look familiar?
Earlier this week on reddit, while chiming in about pythonbrew, I learned it was deprecated in favor of pyenv. Today, I tried it out for myself. Once again, we install (but it doesn't have a separate "python-build" repo)
$ git clone git://github.com/yyuu/pyenv.git .pyenv
enable
# Enable pyenv export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)"
and use
$ pyenv install 3.3.2 ... $ pyenv rehash $ pyenv global 3.3.2 $ python -V Python 3.3.2
And, of course, we can install numpy
$ which pip /home/tim/.pyenv/shims/pip $ pip install numpy ... Successfully installed numpy Cleaning up... $ python Python 3.3.2 (default, Aug 8 2013, 09:21:29) [GCC 4.7.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import numpy >>> numpy.arange(15).reshape(3, 5) array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14]]) >>>
Supergood!
Now I suppose I need an acmenv (pronounced Acme Envy?) to manage all three at once!
Recent Comments