Phoenix compile failing on "module Plug.Conn is not loaded"

702 views
Skip to first unread message

gvim

unread,
Aug 5, 2014, 11:31:39 AM8/5/14
to elixir-l...@googlegroups.com
I reverted to Elixir 14.2.0 (OS X 10.8) for compatibility with Phoenix
but after creating a new Phoenix project the compile phase failed,
beginning with:

Compiled lib/phoenix/html.ex
lib/phoenix/mime.ex:10: warning: this clause cannot match because a
previous clause at line 10 always matches
lib/phoenix/mime.ex:10: warning: this clause cannot match because a
previous clause at line 10 always matches
Compiled lib/phoenix/mime.ex
lib/phoenix/router/resources_context.ex:2: warning: unused alias Path
lib/phoenix/router/resources_context.ex:3: warning: unused alias Stack

== Compilation error on file lib/phoenix/plugs/parsers/json.ex ==
** (CompileError) lib/phoenix/plugs/parsers/json.ex:2: module Plug.Conn
is not loaded and could not be found
(elixir) src/elixir_exp.erl:121: :elixir_exp.expand/2
(stdlib) lists.erl:1352: :lists.mapfoldl/3
(elixir) src/elixir_exp.erl:49: :elixir_exp.expand/2
(elixir) src/elixir.erl:194: :elixir.quoted_to_erl/3
(elixir) src/elixir.erl:163: :elixir.erl_eval/2


Any ideas?

gvim

Onorio Catenacci

unread,
Aug 5, 2014, 11:40:18 AM8/5/14
to elixir-l...@googlegroups.com

gvim

unread,
Aug 5, 2014, 1:01:28 PM8/5/14
to elixir-l...@googlegroups.com
On 05/08/2014 16:40, Onorio Catenacci wrote:
> Check this:
>
> https://groups.google.com/d/msg/elixir-lang-talk/DssIfxihtos/qh-dtLRyFPYJ
>
> (From Eric M-J)
>
> --
> Onorio
>
>

Followed the suggestions in the thread. Now I have a different compile
error:

Compiled lib/phoenix/mime.ex
Generated phoenix.app
==> ph1
Unchecked dependencies for environment dev:
* cowboy (git://github.com/extend/cowboy.git)
the dependency does not match the requirement "~> 0.10.0", got "1.0.0"
** (Mix) Can't continue due to errors on dependencies

.... which seems to be the same as in the subsequent post but the thread
seems inconclusive to me and not much use. Any ideas how I resolve this?

gvim

José Valim

unread,
Aug 5, 2014, 1:08:12 PM8/5/14
to elixir-l...@googlegroups.com
Are you specifying cowboy explicitly or not?

In any case, the fix is probably to add {:cowboy, "~> 1.0", override: true} to your mix.exs file. Once you upgrade Phoenix you should be able to remove it.



José Valim
Skype: jv.ptec
Founder and Lead Developer




gvim

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Doug Goldie

unread,
Aug 5, 2014, 1:49:00 PM8/5/14
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br
That worked for me.....
Though I still have to reorganize my project for the new Phoenix structure (web dir for example).
...hopefully, I'll do that this afternoon.

Details: (someone please correct me if I get it wrong)
I was confused by the old phoenix deps generation for cowboy:


{:cowboy, "~> 0.10.0", github: "extend/cowboy", optional: true},


As Jose explained, the version number is for hex. However, with github param present, mix is pulling master from cowboy.
This was ok when cowboy master was 0.10.0.

Now if you do need to go backwards, it looks like you can specify a github ref, branch, tag, etc.

I haven't tried that yet.

-doug.

 







To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.

gvim

unread,
Aug 5, 2014, 3:47:29 PM8/5/14
to elixir-l...@googlegroups.com
On 05/08/2014 18:49, Doug Goldie wrote:
> That worked for me.....
> Though I still have to reorganize my project for the new Phoenix
> structure (web dir for example).
> ...hopefully, I'll do that this afternoon.
>
> Details: (someone please correct me if I get it wrong)
> I was confused by the old phoenix deps generation for cowboy:
>
> |
>
> {:cowboy,"~> 0.10.0",github:"extend/cowboy",optional:true},
>
> |
>
> As Jose explained, the version number is for hex. However, with github
> param present, mix is pulling master from cowboy.
> This was ok when cowboy master was 0.10.0.
>
> Now if you do need to go backwards, it looks like you can specify a
> github ref, branch, tag, etc.
> http://elixir-lang.org/docs/stable/mix/
>
> I haven't tried that yet.
>

I would be a lot happier if we just had Phoenix working with the current
stable Elixir 15.0 then downgrading to satisfy dependencies wouldn't be
an issue. Maybe I'll just wait.

gvim

gvim

unread,
Aug 5, 2014, 3:49:39 PM8/5/14
to elixir-l...@googlegroups.com
Spoke too soon. Chris has just updated Phoenix. Thanks, Chris.

gvim

gvim

unread,
Aug 5, 2014, 3:57:11 PM8/5/14
to elixir-l...@googlegroups.com
Premature elation :( . The Phoenix I just downloaded produces several
0.14 dependency errors when I compile.

gvim

Lance Halvorsen

unread,
Aug 5, 2014, 4:19:25 PM8/5/14
to elixir-l...@googlegroups.com
Yes, Phoenix master has been updated, but I don't see a new release tag. Releases are what I would think one ought to depend on.

I ran into the same dependency problem over the weekend, btw, and I just updated the cowboy dependency to 1.0.0 locally, but it was only for a test app. I have no idea if all parts of Phoenix will behave as expected with the new version of cowboy. But it does compile and start.  :^)
.L 


On Tue, Aug 5, 2014 at 12:57 PM, gvim <gvi...@gmail.com> wrote:
Premature elation :( . The Phoenix I just downloaded produces several 0.14 dependency errors when I compile.


gvim

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-talk+unsubscribe@googlegroups.com.

Chris McCord

unread,
Aug 5, 2014, 4:40:38 PM8/5/14
to elixir-l...@googlegroups.com
Phoenix master should work on 0.15.0 without errors/warnings, and we are also on Cowboy 1.0. gvim, if you’re seeing differently, please open an issue. A new 0.4.0 release should be out this weekend with all the new features/changes.

To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.

Lance Halvorsen

unread,
Aug 5, 2014, 4:41:49 PM8/5/14
to elixir-l...@googlegroups.com
Oh, actually, I see that Phoenix master has done just that (update the cowboy dependency to 1.0.0).

gvim, I'm curious if you cleaned out all your old dependencies before you re-compiled.
$ mix hex.local                   # make sure you have the right version of hex, for good measure
$ mix deps.clean --all
$ mix do deps.get, compile

.L
Reply all
Reply to author
Forward
0 new messages