Phoenix: Compilation error on a new project

Created on 20 Dec 2015  Â·  11Comments  Â·  Source: phoenixframework/phoenix

I'm trying to setup Phoenix, however after I generate the project and run

mix ecto.create

It prints out

oxyrus:~/workspace/phoenix $ mix ecto.create
==> connection
Compiled lib/connection.ex
Generated connection app
==> fs (compile)
Compiled src/fs_event_bridge.erl
Compiled src/fs.erl
Compiled src/fs_sup.erl
Compiled src/sys/inotifywait.erl
Compiled src/sys/fsevents.erl
Compiled src/fs_app.erl
Compiled src/sys/inotifywait_win32.erl
Compiled src/fs_server.erl
/usr/lib/erlang/lib/parsetools-2.1.1/include/yeccpre.hrl: no such file or directory
==> gettext
could not compile dependency :gettext, "mix compile" failed. You can recompile this dependency with "mix deps.compile gettext", update it with "mix deps.update gettext" or clean it with "mix deps.clean gettext"
==> god
** (Mix) Encountered compilation errors

I'm running it on Ubuntu, already installed the required in the installation docs.

Most helpful comment

You need to install the esl-erlang package which comes with all the tools.

My Phoenix installation procedure for Ubuntu is this:

# Ubuntu 15.10 (wily)
sudo apt-get install inotify-tools
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
wget http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc
sudo apt-get update
sudo apt-get install esl-erlang
sudo apt-get install elixir
mix local.hex
mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.1.0/phoenix_new-1.1.0.ez

All 11 comments

You need to install the Erlang-parsertools package since Ubuntu
unfortunately likes to break Erlang apart. There is another open issue with
instructions to install Erlang from Erlang solutions which is usually
preferred

On Sunday, December 20, 2015, Andrés [email protected] wrote:

I'm trying to setup Phoenix, however after I generate the project and run

mix ectocreate

It prints out

oxyrus:~/workspace/phoenix $ mix ectocreate
==> connection
Compiled lib/connectionex
Generated connection app
==> fs (compile)
Compiled src/fs_event_bridgeerl
Compiled src/fserl
Compiled src/fs_superl
Compiled src/sys/inotifywaiterl
Compiled src/sys/fseventserl
Compiled src/fs_apperl
Compiled src/sys/inotifywait_win32erl
Compiled src/fs_servererl
/usr/lib/erlang/lib/parsetools-211/include/yeccprehrl: no such file or directory
==> gettext
could not compile dependency :gettext, "mix compile" failed You can recompile this dependency with "mix depscompile gettext", update it with "mix depsupdate gettext" or clean it with "mix depsclean gettext"
==> god
** (Mix) Encountered compilation errors

I'm running it on Ubuntu, already installed the required in the
installation docs

—
Reply to this email directly or view it on GitHub
https://github.com/phoenixframework/phoenix/issues/1418.

_José Valim_
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D

You need to install the esl-erlang package which comes with all the tools.

My Phoenix installation procedure for Ubuntu is this:

# Ubuntu 15.10 (wily)
sudo apt-get install inotify-tools
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
wget http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc
sudo apt-get update
sudo apt-get install esl-erlang
sudo apt-get install elixir
mix local.hex
mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.1.0/phoenix_new-1.1.0.ez

Dup of #1411

I'm having the same issue on c9:

tansaku:~/workspace (master) $ mix phoenix.server                                    
==> gettext
Compiling 1 file (.yrl)
/usr/lib/erlang/lib/parsetools-2.1.5/include/yeccpre.hrl: no such file or directory
could not compile dependency :gettext, "mix compile" failed. You can recompile this dependency with "mix deps.compile gettext", update it with "mix deps.update gettext" or clean it with "mix deps.clean gettext"

but the above solution does not appear to work

tansaku:~/workspace (master) $ sudo apt-get install esl-erlang                       
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 esl-erlang : Conflicts: erlang-base-hipe
              Conflicts: erlang-syntax-tools
E: Unable to correct problems, you have held broken packages.

or

Unpacking esl-erlang (1:20.0) ...
dpkg: error processing archive /var/cache/apt/archives/esl-erlang_1%3a20.0_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/erlang/lib/jinterface-1.8/ebin/jinterface.app', which is also in package erlang-jinterface 1:20.0-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/esl-erlang_1%3a20.0_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

any ideas?

and now it's working and I'm not sure why - just seemed to repeat looping, installing erlang etc. here's full history of the commands I did: https://gist.github.com/tansaku/e7b6e3ef6034858b8a5a984c08e7ed20 - tried to capture actual output, but lost some - here's what I have from c9 https://gist.github.com/tansaku/84d052974416a4f094d3a3986a2ecdae just in case this is of use to anyone ...

esl-erlang : Conflicts: erlang-base-hipe
Conflicts: erlang-syntax-tools

For note, the erlang solutions webpage states specifically to not install both esl-erlang and erlang-base/erlang-base-hipe at the same time. The erlang-* packages are just a broken up version of esl-erlang so you do only one or the other.

good to know - not sure that we intentionally installed erlang-base/erlang-base-hipe - perhaps they were a side-effect of installing elixir - and need to be removed before esl-erlang can be installed ... hmm

good to know - not sure that we intentionally installed erlang-base/erlang-base-hipe - perhaps they were a side-effect of installing elixir - and need to be removed before esl-erlang can be installed ... hmm

Correct, if you did not install erlang before elixir then elixir has 2 alternatives for its required packages, one is based on erlang-, the other is based on esl-erlang, but as erlang- is listed first it is installed by default unless you explicitly installed esl-erlang first. :-)

I had this issue on the latest Ubuntu 20.04 LTS (daily build). The issues seems to be that erlang is not installed with all dependencies. When I just typed sudo apt install erlang and repeated the command, it worked.

Same here with 20.04 fresh install sudo apt install elixir only install erlang basic support and mix ecto.create fail:

$ mix ecto.create
==> file_system
Compiling 7 files (.ex)
Generated file_system app
==> connection
Compiling 1 file (.ex)
Generated connection app
==> gettext
Compiling 1 file (.yrl)
/usr/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl: no such file or directory
could not compile dependency :gettext, "mix compile" failed. You can recompile this dependency with "mix deps.compile gettext", update it with "mix deps.update gettext" or clean it with "mix deps.clean gettext"

Fixed running sudo apt install erlang:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ca-certificates-java default-jre-headless erlang-common-test erlang-debugger erlang-dev erlang-dialyzer erlang-diameter erlang-edoc erlang-eldap erlang-erl-docgen erlang-et erlang-eunit
  erlang-examples erlang-jinterface erlang-megaco erlang-mode erlang-observer erlang-odbc erlang-os-mon erlang-reltool erlang-snmp erlang-src erlang-ssh erlang-wx erlang-xmerl java-common
  javascript-common libjs-jquery libjs-jquery-metadata libjs-jquery-tablesorter libodbc1 libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5 openjdk-11-jre-headless
Suggested packages:
  default-jre erlang-manpages erlang-doc xsltproc fop apache2 | lighttpd | httpd libmyodbc odbc-postgresql tdsodbc unixodbc-bin fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho
  fonts-wqy-microhei | fonts-wqy-zenhei
The following NEW packages will be installed:
  ca-certificates-java default-jre-headless erlang erlang-common-test erlang-debugger erlang-dev erlang-dialyzer erlang-diameter erlang-edoc erlang-eldap erlang-erl-docgen erlang-et erlang-eunit
  erlang-examples erlang-jinterface erlang-megaco erlang-mode erlang-observer erlang-odbc erlang-os-mon erlang-reltool erlang-snmp erlang-src erlang-ssh erlang-wx erlang-xmerl java-common
  javascript-common libjs-jquery libjs-jquery-metadata libjs-jquery-tablesorter libodbc1 libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5 openjdk-11-jre-headless
0 upgraded, 35 newly installed, 0 to remove and 0 not upgraded.
Need to get 66,6 MB of archives.
After this operation, 279 MB of additional disk space will be used.

I'm on Ubuntu Groovy Gorilla and installing the erlang-dev package, which is needed to provide yeccpre.hrl fixed it for me.

sudo apt-get install erlang-dev

Was this page helpful?
0 / 5 - 0 ratings