Introduction
Opening remarks
I’m not a Ruby developer, and I’m heavily discovering the ecosystem by now. This are my notes, and if anything seems wrong to you, do not hesitate to send me remarks.
The scenario
For testing purpose, I wanted to play with vagrant-aws and more generally with ruby on my Chromebook.
Vagrant does not support rubygems as installation method anymore (see Mitchell Hashimoto’s post) and of course, there is no binary distribution available for the Chromebook.
So I have to install it from the sources.
The documentation says:
- Do NOT use the system Ruby - use a Ruby version manager like rvm, chruby, etc
Alright, anyway I don’t want to mess with my system and break Homebrew, so using RVM seems to be a good idea.
Installing RVM
The RVM installation is relatively easy; simply running curl -sSL https://get.rvm.io | bash
does the trick.
And then those commands make ruby 2.3.0 available via rvm:
$ source ~/.rvm/scripts/rvm
$ rvm install 2.3.0
The stupid trick here is that everything is installed in my $HOME directory, and as my Chromebook is short on disk space: FS full !
Too bad.
Using a USB stick
So my idea is to install the RVM suite onto a USB stick (because with me I don’t have any SDHC card available).
Preparing the stick
At first, the USB stick must be formatted in extendX (ext4) in order to be able to use symlinks, correct ownership etc.
|
|
Note: I’ve found that avoiding spaces in the volume name was good for rvm.
Once connected on the Chromebook, it’s automatically mounted on /media/removable/Lexar
.
The problem are the options:
|
|
the most problematic is noexec
because I want to install executables in it.
So what I did was simply:
sudo mount -o remount /dev/sda1 /media/removable/Lexar
and that did the trick.
Installing RVM on the USB
I will install rvm into /media/removable/Lexar/rvm
. In order to avoid any ownership and permission problem I did:
|
|
And then I created a simple ~/.rvmrc
file as indicated in the documentation with this:
|
|
I also included this in my ~/.zshrc
|
|
Installing rvm
the command I executed were then:
$ curl -sSL https://get.rvm.io | bash
$ source /media/removable/Lexar/rvm/scripts/rvm
$ rvm autolibs enable
$ rvm get stable
$ rvm install 2.3.0
And that did the trick
$ rvm list
rvm rubies
=* ruby-2.3.0 [ x84_64 ]
# => - current
# =* - current && default
# * - default
Testing with vagrant
Cloning the vagrant sources
|
|
Preparing the rvm file for vagrant
To use the ruby 2.3.0 (that I’ve installed before) with vagrant, I need to create a .rvmrc in the vagrant directory:
$ cd /media/removable/Lexar/tools/vagrant
$ rvm --rvmrc --create 2.3.0@vagrant
Installing bundler
The bundler version that is supported by vagrant must be <= 1.5.2 as written in the Gemfile
. So I’m installing version
1.5.2
|
|
Compiling vagrant
Back to the vagrant documentation, what I must do is now to “compile it”. To do so, the advice is to run:
$ bundle _1.5.2_ install
(just in case several bundler are present )
I faced this error:
|
|
According to google, this may be an issue with the version of bundler I’m using. As I cannot upgrade the bundler because of vagrant, I’ve decided to take a chance and use a lower version of Ruby
|
|
Voilà!
I can now use vagrant installed fully on the USB stick with
|
|
That’s it for this post; next I will try to install vagrant-aws and play a little bit with it.
stay tuned.