Elixir is a functional programming language that builds off of Erlang. Cloud9 provides syntax highlighting for Elixir files and setting up an Elixir environment with Cloud9 is doable with the following instructions and commands:
- Create a new workspace.
- Select the “Blank” template (or any template will work).
- When the workspace loads, run the following commands in the terminal:
# For some reason, installing Elixir tries to remove this file # and if it doesn't exist, Elixir won't install. So, we create it. sudo touch /etc/init.d/couchdb # Standard Ubuntu Elixir installation instructions wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb sudo dpkg -i erlang-solutions_1.0_all.deb sudo apt-get update sudo apt-get install elixir
Now Elixir is installed and ready to run. Go ahead and create a new
.exs file, you could call it
hello.exs. Open the file and paste the following code for a simple hello world:
IO.puts "Hello world from Elixir"
Open the terminal and run
elixir hello.exs and you should see the following output:
Hello world from Elixir
Now you’ve got your first Elixir program going and you’re ready to write more Elixir!
mix should all be available and Cloud9 has syntax coloring for Elixir code. Happy coding!