Elixir 'hello, world' (using vagrant + ubuntu)
概要
関数型言語 Elixir 環境を Vagrant で作成して hello, world する
前提
OS : Ubuntu1204
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$script = <<SCRIPT
sudo wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update -y
sudo apt-get install elixir
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider :virtualbox do |vb|
vb.name = "elixir"
end
config.vm.box = "precise64"
config.vm.provision "shell", inline: $script
end
出力
$ elixir -v
Elixir 1.0.0
対話環境 iex で hello, world する
$ iex
iex(1)> IO.puts "hello, world"
hello, world
:ok