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

Make it easier to install? #12

Closed
dbenamy opened this issue Apr 24, 2014 · 8 comments
Closed

Make it easier to install? #12

dbenamy opened this issue Apr 24, 2014 · 8 comments

Comments

@dbenamy
Copy link

dbenamy commented Apr 24, 2014

I'm new to elixir and I'm having some trouble getting postgrex & ecto installed.

I brew installed elixir 0.13.0. It looks to me like the latest postgrex depends on a dev version of elixir. I found an older revision (7bb042d) and put that in my mix.exs and then I'm able to install it with "mix deps.update postgrex", but I can't compile because ecto wants a newer version of postgrex. I browsed through the ecto history a bit but it wasn't clear to me what revision to use.

Is there any easy way to do this without installing a dev version of elixir?

Thanks very much!

@josevalim
Copy link
Member

Hey @dbenamy, we are sorry about that. We released postgrex depending on elixir-dev by accident and that is what is causing pain.

Please try using this commit: ec804cb

@dbenamy
Copy link
Author

dbenamy commented Apr 24, 2014

Thanks for the quick reply!

I changed my mix.exs to have

  defp deps do
    [
      {:phoenix, github: "phoenixframework/phoenix"},
      {:postgrex, "0.4.2", github: "ericmj/postgrex", tag: "ec804cb"}, # this revision works with elixir 0.13.0
      {:ecto, github: "elixir-lang/ecto"}
    ]
  end

ran

mix deps.clean --all
mix deps.get
mix deps.update postgrex

which gave normal looking output, and then

mix compile
Unchecked dependencies for environment dev:
* postgrex (git://github.com/ericmj/postgrex.git)
  the dependency postgrex in mix.exs is overriding a child dependency:

  > In mix.exs:
    {:postgrex, "0.4.2", [git: "git://github.com/ericmj/postgrex.git", tag: "ec804cb"]}

  > In deps/ecto/mix.exs:
    {:postgrex, "~> 0.4.0", [git: "git://github.com/ericmj/postgrex.git", optional: true]}

  Ensure they match or specify one of the above in your Statman.Mixfile deps and set `override: true`
** (Mix) Can't continue due to errors on dependencies

Am I missing something?

@ericmj
Copy link
Member

ericmj commented Apr 24, 2014

You need to add override: true, like this: {:postgrex, "0.4.2", github: "ericmj/postgrex", tag: "ec804cb", override: true}.

@dbenamy
Copy link
Author

dbenamy commented Apr 24, 2014

That did it, thanks!!

Why does the override setting exist? If the version and/or tag are given, I would think that it's clear what the dev wants. But I'm really new at all this so I'm probably missing some important piece :-)

@dbenamy dbenamy closed this as completed Apr 24, 2014
@josevalim
Copy link
Member

@dbenamy the override exists because you may accidentally replace a dependency specified below. The override is to make sure you are defining it exactly because you want to override something.

@dbenamy
Copy link
Author

dbenamy commented Apr 24, 2014

Got it. Thanks for the explanation.

Want me to take a stab at a patch which updates the error message to
explain this and how to solve it?

On Thu, Apr 24, 2014 at 12:21 PM, José Valim notifications@github.comwrote:

@dbenamy https://github.com/dbenamy the override exists because you may
accidentally replace a dependency specified below. The override is to make
sure you are defining it exactly because you want to override something.


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-41300389
.

@ericmj
Copy link
Member

ericmj commented Apr 24, 2014

@dbenamy The error message already includes the solution. From what you pasted: "Ensure they match or specify one of the above in your Statman.Mixfile deps and set override: true".

Do you think it should be more clear?

@dbenamy
Copy link
Author

dbenamy commented Apr 24, 2014

Oh :-) Now that I read it more carefully, I totally understand what it's saying. Maybe I was too new to elixir or too tired to process it at the time.

If I was going to rewrite the message though, I might have it say something like this

$ mix compile
** (Mix) Can't continue due to errors on dependencies
"projdir/mix.exs" has this dependency:
    {:postgrex, "0.4.2", [git: "git://github.com/ericmj/postgrex.git", tag: "ec804cb"]}
which conflicts with another dependency in "projdir/deps/ecto/mix.exs":
    {:postgrex, "~> 0.4.0", [git: "git://github.com/ericmj/postgrex.git", optional: true]}

Normally, you should change "projdir/mix.exs" to specify the same version as ecto, for example:
    {:postgrex, "~> 0.4.0", [git: "git://github.com/ericmj/postgrex.git"]}
If you really want to use the version in "projdir/mix.exs", add the override setting like this:
    {:postgrex, "0.4.2", [git: "git://github.com/ericmj/postgrex.git", tag: "ec804cb", override: true]}

But it's probably not too important.

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

3 participants