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 12 to 3

NobbZ

NobbZ

The PATH-variable is set that the operating system is able to find an executable that is called “unqualified”. You can always call an executable file by qualifing it as in “./configure” or “/usr/bin/bash”. No executable file will ever look at PATH to find a file that’s given to it as an argument (unless it has very obscure reasons to). If you need to give a file as an argument to an executable, then you always need to specify its relative path to the current working directory (or the full path from the root of the filesystem).

Fernando

Fernando OP

This work! thx :D!, so can someone explain me for what is this Installing Elixir - The Elixir programming language? i put the elixir bin path and the path where sublime save file,and thought that would work.

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.

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

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

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

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.

Fernando

Fernando OP

I will read that, thx.

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.

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.

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
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
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews