checkiz / elixir-mongo

MongoDB driver for Elixir
MIT License
101 stars 31 forks source link

Check that socket application is well started before using mongo #1

Closed sebastiencv closed 10 years ago

sebastiencv commented 10 years ago

I have got the following error message using elixir-mongo :

** (FunctionClauseError) no function clause matching in :inet.tcp_controlling_process/2
     stacktrace:
       (kernel) inet.erl:1485: :inet.tcp_controlling_process(#Port<0.38160>, nil)
       lib/socket/tcp.ex:136: Socket.TCP.connect/3
       lib/socket/tcp.ex:120: Socket.TCP.connect!/2

The reason was that I did not included :socket in in the applications to start in the project mix.exs file.

Maybe that could be checked by Mongo.mongo or Mongo.connect

jerp commented 10 years ago

You need to add :mongo as a dependency in your mix file

  def application do
    [applications: [:mongo]]
  end