Fernando

Fernando

Hello, im new to elixir and new to linux(using ubuntu 14.04 now), started this week. Im following this http://elixir-lang.org/getting-started/modules.html i feel like is a fool question but how i create a file? or where i have tu put? i created one with sublime text 2 but can’t compile in the terminal. Also if you have any advices of learning, would be great! .Thx.

Showing Posts 1 to 10

ejc123

ejc123

I found that reading this part of the guide and then using mix to create a new project was helpful.

NobbZ

NobbZ

To give you the best help on this we need to know how exactly you created that file using sublime and how you tried to compile it. Both including full path of where saved and where run the commands to compile.

AstonJ

AstonJ

You can simply save files with the .ex or .exs extension.

.exs is scripted mode, and does not need to be compiled - have a look here in the guide.

Fernando

Fernando OP

I write on sublime(have elixir bundle) and save it like .exs in documents, the open terminal and put: $ elixir math.exs . No file named appears, so i think i have to put in another path but dont know where.

Fernando

Fernando OP

I will read that, thx.

NobbZ

NobbZ

Then you’ll have to check where sublime saved the file on disk, open a terminal cd to that path and try elixir command again. If this sentence means nothing to you, you should start out with a Linux tutorial. I don’t have on at hand, I was guided through my first Linux steps 20 years ago, long before we had internet at home by a friend of my father. Before that I’ve grown up with DOS so some concepts were already known to me.

AstonJ

AstonJ

Are you on OS X? If so open a terminal window and enter cd desktop which will take you to the desktop, then make sure your file is on the desktop, then simply use the command to run the file, e.g. elixir my_file.exs.

NobbZ

NobbZ

Nope, he isn’t :wink: According to the starting post he uses Ubuntu 14.04 LTS and is new to linux and elixir as well.

AstonJ

AstonJ

Ah right sorry :lol:

The same thing should work though - navigate to the folder where the file is and run the Elixir command from there. Alternatively, if you can get to your file you can usually just drag it into a terminal window and location will show, which you can then just prefix with elixir, e.g:

elixir /Users/Aston/code/my_file.exs
NobbZ

NobbZ

Oh and if that file is really named math.exs, try find ~ -name 'math.exs' in an open terminal, it might take quiiiiite a whiiiiiile… Go drink a cup can of coffee :wink:

Somewhere in that output there should be a line showing you the path to the file.

Another way (assuming Unity) is to enter the name of the file in the opened dashboard. If I do recall correctly it might show you exactly that file you created then. You can rightclick this and “open filemanager at path” or depending on your config even “open terminal at path” or something along that lines. Also this does only work if zeitgeist (indexing demon) is installed and enabled[1]. Also it is about 3 years ago I used Unity the last time, memory is fading and things could have changed.

[1] It is both by default since it is a hard dependency of Unity, but since it can be a real CPU, HDD and RAM hogger, many people do some tricks to “deactivate” it.

Where Next? Top

Trending in Questions Top

Hellowman
Hello everyone! I am new to coding with Elixir/Erlang. And i am looking for some utilities for fuzzing testing like AFL++. Does anyone ...
New
yarrichar
I’m very new to Elixir, so sorry if this is a silly question: I am wondering what happens to the mailbox of a process when the machine i...
New
pragdave
How do I tell Hologram not to escape HTML when substituting into templates? {Textile.render(@product.long_description)} escapes the HTM...
New
mandar1045
I load tested a plain Phoenix chat app backed by Postgres with 100 million messages in it, everything on default settings, to see what br...
New
Fl4m3Ph03n1x
Background When trying to execute mix release on a Windows 11 machine for a Phoenix project I get the following error: * assembling mark...
New
rlipscombe
I’d like to create a file with 600 permissions (rw-------), but there’s a race condition if I create it and then change the permissions. ...
New
saleyn
Is there a way to import record definitions in the iex shell for pretty printing (similar to the rr command in the erl shell)? This woul...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
261 13183 112
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews