Overbryd / gcloudex

Friendly set of wrappers for Google Cloud Platform services' API's in Elixir.
64 stars 39 forks source link

Compilation error #2

Closed migore closed 8 years ago

migore commented 8 years ago

Hey, when I try to use this library as a dependency it is failing to compile, I get the following message:

== Compilation error on file lib/compute_engine/machine_types.ex ==
** (ArgumentError) argument error
    :erlang.iolist_to_binary(nil)
    lib/poison/parser.ex:35: Poison.Parser.parse/2
    lib/poison/parser.ex:50: Poison.Parser.parse!/2
    lib/poison.ex:83: Poison.decode!/2
    lib/gcloudex.ex:14: GCloudex.get_project_id/0
    lib/compute_engine/machine_types.ex:2: (module)

I tried with Elixir 1.2.3 and Erlang/OTP 18 [erts-7.3].

sashaafm commented 8 years ago

Hi @migore, you're missing the configs. I still haven't updated the README with them. You must insert into your config files (dev.exs or whatever environment you're using) the following config:

config :gcloudex,
  project:  "<project_id>"

 config :goth, 
  json: "config/creds.json" |> Path.expand |> File.read!

config :logger,
  level: :debug

The creds.json file is the file you can download from your Google Cloud Platform console. It's a JSON file with all your credentials and access keys. Place it inside the config folder with the name 'creds.json' (or alter the config to the name you want).

sashaafm commented 8 years ago

Please keep in mind that this library is in its early stages and is under active development. Over the coming 2 or 3 months expect updates with Google Compute Engine and Datastore or Big Table (as well as test suites).

migore commented 8 years ago

Works like a charm! Thanks!