Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gettext fails to compile in Phoenix 1.1.0 installation #67

Closed
cedricgc opened this issue Dec 17, 2015 · 14 comments
Closed

gettext fails to compile in Phoenix 1.1.0 installation #67

cedricgc opened this issue Dec 17, 2015 · 14 comments

Comments

@cedricgc
Copy link

Hello, when trying to compile dependencies in a new Phoenix 1.1.0 application the libary gettext fails to compile. It seems to not recgonize a module called :yecc. I have reproduced the error with some other info that may be useful. let me know if there anything else you need.

$ elixir --version
Elixir 1.1.0
$ erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
"18"
$ uname -a
Linux worker 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.1.0/phoenix_new-1.1.0.ez
Found existing archive(s): phoenix_new-1.0.4.ez.
Are you sure you want to replace them? [Yn] Y
creating .mix/archives/phoenix_new-1.1.0.ez
$ mix phoenix.new example
...
$ cd example
$ cat mix.lock
%{"connection": {:hex, :connection, "1.0.2"},
"cowboy": {:hex, :cowboy, "1.0.4"},
"cowlib": {:hex, :cowlib, "1.0.2"},
"decimal": {:hex, :decimal, "1.1.0"},
"ecto": {:hex, :ecto, "1.1.0"},
"fs": {:hex, :fs, "0.9.2"},
"gettext": {:hex, :gettext, "0.9.0"},
"phoenix": {:hex, :phoenix, "1.1.0"},
"phoenix_ecto": {:hex, :phoenix_ecto, "2.0.0"},
"phoenix_html": {:hex, :phoenix_html, "2.3.0"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.0.1"},
"plug": {:hex, :plug, "1.0.3"},
"poison": {:hex, :poison, "1.5.0"},
"poolboy": {:hex, :poolboy, "1.5.1"},
"postgrex": {:hex, :postgrex, "0.10.0"},
"ranch": {:hex, :ranch, "1.2.0"}}
$ mix deps.compile
==> connection
Compiled lib/connection.ex
Generated connection app
==> poolboy (compile)
Compiled src/poolboy_worker.erl
Compiled src/poolboy_sup.erl
Compiled src/poolboy.erl
==> decimal
Compiled lib/decimal.ex
Generated decimal app
==> poison
Compiled lib/poison.ex
Compiled lib/poison/decoder.ex
Compiled lib/poison/parser.ex
Compiled lib/poison/encoder.ex
Generated poison app
==> 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"
** (UndefinedFunctionError) undefined function: :yecc.file/2 (module :yecc is not available)
:yecc.file('src/gettext_po_parser.yrl', [parserfile: 'src/gettext_po_parser.erl', report: true])
(mix) lib/mix/compilers/erlang.ex:84: anonymous fn/3 in Mix.Compilers.Erlang.compile/3
(elixir) lib/enum.ex:1385: Enum."-reduce/3-lists^foldl/2-0-"/3
(mix) lib/mix/compilers/erlang.ex:83: Mix.Compilers.Erlang.compile/3
(elixir) lib/enum.ex:1043: anonymous fn/3 in Enum.map/2
(elixir) lib/enum.ex:1385: Enum."-reduce/3-lists^foldl/2-0-"/3
(elixir) lib/enum.ex:1043: Enum.map/2
(mix) lib/mix/tasks/compile.all.ex:19: anonymous fn/1 in Mix.Tasks.Compile.All.run/1

@zhangsoledad
Copy link

The problem also happen on my server when i upgrade phoenix 1.1
b7040f66-4189-4ce1-99a8-1b9f39846813

@josevalim
Copy link
Contributor

How did you install Erlang? You are missing the Erlang parser or Erlang
parser tools package.

On Thursday, December 17, 2015, zhangsoledad notifications@github.com
wrote:

The problem also happen on my server when i upgrade phoenix 1.1
[image: b7040f66-4189-4ce1-99a8-1b9f39846813]
https://cloud.githubusercontent.com/assets/3198439/11862143/70d9cc18-a4c2-11e5-81bc-87808c61783a.png


Reply to this email directly or view it on GitHub
#67 (comment).

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

@josevalim
Copy link
Contributor

You are likely missing the Erlang-parsetools package. Some distributions break Erlang into multiple Packages so you need to install them manually. Elixir v1.2 will include a better error message.

@zhangsoledad
Copy link

@cedricgc
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install erlang
in my aws EC2(ubuntu) it work

@josevalim
Copy link
Contributor

Did it solve the problem or this is how it was installed? :)

On Thursday, December 17, 2015, zhangsoledad notifications@github.com
wrote:

@cedricgc https://github.com/cedricgc
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
&& sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install erlang
in my aws EC2(ubuntu)


Reply to this email directly or view it on GitHub
#67 (comment).

José Valimwww.plataformatec.com.br
http://www.plataformatec.com.br/Founder and Director of R&D

@zhangsoledad
Copy link

@josevalim I install elixir follow http://elixir-lang.org/install.html
2e1a298d-2578-4360-810c-f1a35af6dc50
sudo apt-get install erlang can solve the problem

@cedricgc
Copy link
Author

I too followed the instructions on the official website for the Ubuntu box. I think the erlang bundled with the elixir install does not have the required packages. I will try again when I get back home and report results.

@cedricgc
Copy link
Author

Following @zhangsoledad instructions resolved the issue. I think the erlang shipped with elixir needs to be updated with these libraries or have Ubuntu and Debian boxes explicitly apt-get install erlang as well as elixir in the download instructions.

@josevalim
Copy link
Contributor

That's the problem, the default erlang in ubuntu and debian installs is broken into multiple packages. There is nothing we can do about it, I think it was already asked multiple times for them to not do that.

@cedricgc
Copy link
Author

I suggest for the ubuntu and debian instructions on http://elixir-lang.org/install.html have another line explicitly downloading erlang through apt-get after apt-get install elixir

whatyouhide added a commit that referenced this issue Jan 22, 2016
I added a `:ensure_yecc_compiler` Mix compiler that raises when the
`:yecc` module is missing (because the `:parsetools` Erlang application
is missing). This should help a lot with issue #67.
@adam-stokes
Copy link

Just to add to this, I actually followed the instructions at http://elixir-lang.org/install.html as well but on my ubuntu 14.04 install I needed to also do:

sudo apt-get install erlang-parsetools
sudo apt-get install erlang-dev

Not sure if I even need erlang-parsetools but that was the ordered I did and seemed to work smoothly after that.

@mibamur
Copy link

mibamur commented Mar 9, 2016

@battlemidget thanks

@jmccaffrey
Copy link

I've been trying to get this all running on cloud9, so I can work with students and help them play around with elixir & phoenix, and I was stuck with this gettext issue.
Thanks for the tip on
sudo apt-get install erlang-dev
that solved my problem
(for whatever reason erlang-parsetools would not install everything)

@adam-stokes
Copy link

@jmccaffrey erlange-parsetools probably didn't depend on erlang-dev

marcelocg added a commit to marcelocg/phoenix-docker that referenced this issue Mar 27, 2016
Erlang on Ubuntu is provided in multiple packages and some dependencies could be missing and cause issues when running

```shell
$ mix deps.get
```

See elixir-gettext/gettext#67 for more details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants