Excl_archive_filters error when installing nitrogen on mac os

Just bought the Nitrogen book and tried to install Nitrogen :slight_smile: on mac os, but got this error. I am new to Nitrogen and erlang releases… what would the best road ahead? Thanks :pray:

(base) MacBook-Air:nitrogen ulrikvendelbo$ make rel_inets PROJECT=testproj
./rebar get-deps
==> rel (get-deps)
==> nitrogen (get-deps)
./rebar compile
==> rel (compile)
==> nitrogen (compile)

Creating full release in …/testproj with inets

==> rel (generate)
excl_archive_filters is no longer supported in reltoolERROR: generate failed while processing /Users/ulrikvendelbo/dev/nitrogen/rel: {‘EXIT’,{{badmatch,{error,“Illegal option: [{incl_cond,include}]”}},
make[3]: *** [generate] Error 1
make[2]: *** [rel_inner_full] Error 2
make[1]: *** [rel] Error 2
make: *** [rel_inets] Error 2
(base) MacBook-Air:nitrogen ulrikvendelbo$

Hi @inforista,

Try this from the base of your nitrogen directory:

git checkout rebar3

Then try the same make command.

This isn’t in the book and is temporary fix until Nitrogen 3 is released, then I’ll update the book as necessary (but it’s mostly backwards compatible).

Sorry for the trouble, my busy season just ended so I’ll have time to finally wrap up N3 :slight_smile:

Thanks :slight_smile:

It helped a bit, but now I am stuck with something in the escript:

(base) MacBook-Air:nitrogen ulrikvendelbo$ ls

(base) MacBook-Air:nitrogen ulrikvendelbo$ make rel_inets PROJECT=testproj

Generating backend templates and re-deploying Rebar templates
Generating rebar.cowboy.config and rebar.cowboy.config.script
escript: exception error: no match of right hand side value {error,eacces}
make[1]: *** [template] Error 127
make: *** [rel_inets] Error 2

(base) MacBook-Air:nitrogen ulrikvendelbo$

I have looked into the build_backend_configs.escript but can’t figure it out myself … hope you have an idea?

I have learned more: :slight_smile: BUT everything is not working yet

The error is raised in build_backend_configs.escript in the line:

→ {ok, FileBin} = file:read_file(FromFile) ←

And is due to permission rights. When I try to make a nitrogen project and uses sudo first it helps:

(base) MacBook-Air:nitrogen ulrikvendelbo$ sudo make rel_inets PROJECT=testproj
Generating backend templates and re-deploying Rebar templates
Generating rebar.cowboy.config and rebar.cowboy.config.script
Generating rebar.inets.config and rebar.inets.config.script
Generating rebar.mochiweb.config and rebar.mochiweb.config.script
Generating rebar.webmachine.config and rebar.webmachine.config.script
Generating rebar.yaws.config and rebar.yaws.config.script
Copying Template Files to ./config/rebar3/templates/nitrogen
#@(cp -R templates/plugin ~/.config/rebar3/templates/nitrogen_plugin)
#@(cp nitrogen_plugin.template ~/.config/rebar3/templates/nitrogen/nitrogen_win.template)

Creating a project that will default to a full release
in …/testproj with inets

/bin/sh: ./rebar3: is a directory
make[1]: *** [rel] Error 126
make: *** [rel_inets] Error 2
(base) MacBook-Air:nitrogen ulrikvendelbo$

Now I just have to figure out why the makefile is making the two errors:

make[1]: *** [rel] Error 126
make: *** [rel_inets] Error 2

Any Ideas for a solution? :slight_smile:

ps. I think it is something with this part of the Makefile code:

rel: rebar3 check_exists template
@echo “Creating a project that will default to a full release”
@echo “in $(PREFIX)/$(PROJECT) with $(PLATFORM)”
@echo "

@($(REBAR) new nitrogen name=$(PROJECT) prefix=$(PREFIX) backend=$(PLATFORM) include_erts=true)
@(cd $(PREFIX)/$(PROJECT); make rebar2_links)
@(cd $(PREFIX)/$(PROJECT); make cookie)
@echo Generated a new Nitrogen project
@echo in ‘$(PREFIX)/$(PROJECT)’, configured to run on $(PLATFORM) with a full release
@echo "

Hi @Inforista, I’m not entirely sure. I’m on vacation right now and don’t have my mac with me, so I can’t for sure say if it’s a Mac issue or not.

But one thing I might try is to head into your …/testproj directory and see if there is a rebar3 directory. If there is, go ahead and delete it and try the make command again and maybe that will work?

Just bouncing in here.

I did some tests last night with my Mac and didn’t experience this issue generating projects and running them with Erlang 26 and the rebar3 branch of Nitrogen.

Are you still experiencing this issue?

Hi, thank you for following up :slight_smile:

I finally got time to try get the nitrogen installation problems fixed yesterday after having been away for a science seminar. It took some time but I finally got it to work and now Nitrogen is running :grinning:

I think the problems was a combination of things … one of wich is that I recently migrated from macbook air with intell chip to a new macbook air M2 with apple silicon.

So I ended up dooing the following to get it to work on my mac:

  • uninstalled Brew and all repos completely
  • reinstalled CLI
  • reinstalled Brew
  • reinstalled Erlang

did some testing and ended with this combination of commands to get it to work:

  1. check if /tmp/rebar3 folder already exists … if it does then: sudo rm -r rebar3

  2. git clone GitHub - nitrogen/nitrogen: Nitrogen Web Framework for Erlang (now with websockets!)

  3. cd nitrogen

  4. git checkout rebar3

  5. sudo make rel_inets PROJECT=uv1app

  6. cd to uv1app

  7. sudo make run_dev

This is working for me :slight_smile:
Note: if I dont use step 4 or sudo in step 5 & 7 then it does not work.

Now looking forward to play around with Nitrogen, read your book, learn more and build some cool stuff :grinning:

Awesome! I appreciate the insight into what was wrong. I’ll have to add an extra check for the existance of /tmp/rebar3. Maybe just clone into a random directory in tmp is the simplest (these are me thinking out loud, not instructions for you :slight_smile: )

1 Like

I dont know if possible/relevant, but maybe also some check of permission settings, and guidance → goal is to avoid the need of using sudo for some commands as I apparently need to get it to work :slight_smile:

Yeah, the sudo thing is weird. That’s definitely not a situation I’m running into on my mac, but I also have an intel chip mac. That part is a bit puzzling to me. You could try messing with the PREFIX argument (by default PREFIX=.. so it’s just installing into the same directory where you cloned nitrogen.

If you were to, say, do something like:

make rel_inets PROJECT=uv1app PREFIX=~

Maybe that would work without having to use sudo

Also worth noting in Nitrogen 3, you can just run make build which will walk you through some of the steps as well (minimizing the arcana required to generate projects of varying configs)