mikejm

mikejm

Running Elixir application on Ubuntu inside Windows? Ubuntu says it "could not touch" the beam file generated on trying to run project?

I installed Ubuntu on Windows for Elixir development as some of the packages I need are not Windows compatible. So I need to test/run my existing Phoenix/Elixir project from inside this Ubuntu command line.

I got Elixir/Erlang/Phoenix installed okay, but when I navigate to an existing directory where I have a project like cd /mnt/h/users/mike/documents/testserver/ and run iex -S mix phx.server I get:

==> file_system
Compiling 7 files (.ex)
** (EXIT from #PID<0.99.0>) an exception was raised:
    ** (File.Error) could not touch "/mnt/h/users/mike/documents/testserver/_build/dev/lib/file_system/ebin/Elixir.FileSystem.beam": not owner
        (elixir 1.16.0) lib/file.ex:631: File.touch!/2
        (elixir 1.16.0) lib/kernel/parallel_compiler.ex:334: anonymous fn/3 in Kernel.ParallelCompiler.write_module_binaries/3
        (elixir 1.16.0) lib/enum.ex:1264: anonymous fn/3 in Enum.flat_map/2
        (stdlib 5.2) maps.erl:416: :maps.fold_1/4
        (elixir 1.16.0) lib/enum.ex:2540: Enum.flat_map/2
        (elixir 1.16.0) lib/kernel/parallel_compiler.ex:260: Kernel.ParallelCompiler.spawn_workers/3
        (mix 1.16.0) lib/mix/compilers/elixir.ex:1002: anonymous fn/9 in Mix.Compilers.Elixir.compiler_loop/6

Do you know what this might represent?

I tried deleting the _build folder and letting it make it again but it just creates a new _build folder with only Elixir.FileSystem.beam and fails after that same error.

Is there some trick to running this setup I’m missing in terms of file access on Ubuntu on Windows?

If I try to access the project like nano mix.exs I can edit the file and save so I do have permissions but the Elixir build is not running.

elixir -v gives Erlang/OTP 26 & Elixir 1.16.0 which seems to be as expected.

Thanks for any help.

Marked As Solved

mikejm

mikejm

Found the missing trick. When you install Ubuntu on Windows it makes you create a new username and password, but when you check chown all your files are owned by root (which will not be who you will be auto set up as.

You need to follow the instructions here:

Basically, close the Ubuntu down and from an elevated command prompt run ubuntu config --default-user root then restart your Ubuntu and you will be in as root with normal ability to do anything after that.

Though you will have to reinstall elixir/erlang again.

Leaving this as a solution in case anyone else finds it.

Where Next?

Popular in Questions Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; someth...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New

We're in Beta

About us Mission Statement