4
4

More than 5 years have passed since last update.

Elixir 'hello, world' (using vagrant + ubuntu)

Posted at

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

参照

Elixir Official

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4