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

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; ...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; somethi...
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
chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36352 110
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39467 209
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement