Hanamiをコマンドどおりに実行したらエラーになった件について

#はじめに
Ruby界隈で話題になっているHanamiというフレームワーク。ﾖｯｼｬｲｸｿﾞ!wと思ってまずはやってみた。

# コマンドを叩いてみると...
```bash
$ gem install hanami
$ hanami new app
$ bundle install
```
fmfm。こりゃRailsのおまじないとおんなじ感じでいけそうやん。あとは` rails s` よろしく `hanami s` やなと思って叩いてみたところ...

```
$ bundle exec hanami server
wrong number of arguments (given 1, expected 2)
/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/dotenv-2.3.0/lib/dotenv/parser.rb:33:in `call'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/hanami-1.2.0/lib/hanami/env.rb:59:in `load!'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/hanami-1.2.0/lib/hanami/environment.rb:493:in `set_application_env_vars!'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/hanami-1.2.0/lib/hanami/environment.rb:475:in `set_env_vars!'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/hanami-1.2.0/lib/hanami/environment.rb:197:in `block in initialize'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/hanami-1.2.0/lib/hanami/environment.rb:197:in `synchronize'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/hanami-1.2.0/lib/hanami/environment.rb:197:in `initialize'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/hanami-1.2.0/lib/hanami/cli/commands/command.rb:76:in `new'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/hanami-1.2.0/lib/hanami/cli/commands/command.rb:76:in `call'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/hanami-cli-0.2.0/lib/hanami/cli.rb:57:in `call'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/hanami-1.2.0/bin/hanami:6:in `<top (required)>'
	/Users/user/.rbenv/versions/2.5.0/bin/hanami:23:in `load'
	/Users/user/.rbenv/versions/2.5.0/bin/hanami:23:in `<top (required)>'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `load'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `kernel_load'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:28:in `run'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/cli.rb:424:in `exec'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/cli.rb:27:in `dispatch'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/cli.rb:18:in `start'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/exe/bundle:30:in `block in <top (required)>'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/friendly_errors.rb:122:in `with_friendly_errors'
	/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/exe/bundle:22:in `<top (required)>'
	/Users/user/.rbenv/versions/2.5.0/bin/bundle:23:in `load'
	/Users/user/.rbenv/versions/2.5.0/bin/bundle:23:in `<main>'
```

***ファッ！！？***

# 解決策
Hanamiのコミュニティにて、`dotenv` というgemのバージョン指定がよくない模様。たしかに/dotenv/parser.rbが悪さしているっぽい。
[hanami/chat](https://gitter.im/hanami/chat?at=5ad970d32b9dfdbc3aac7b0c)

Gemfileのdotenv指定を`2.2.2`に変更する

```vim:Gemfile
group :test, :development do
  gem 'dotenv', '~> 2.2.2'
end
```

からの、起動！

```bash
$ bundle exec hanami server
[2018-04-23 21:03:04] INFO  WEBrick 1.4.2
[2018-04-23 21:03:04] INFO  ruby 2.5.0 (2017-12-25) [x86_64-darwin16]
[2018-04-23 21:03:04] INFO  WEBrick::HTTPServer#start: pid=10757 port=2300
```

http://localhost:2300

![スクリーンショット 2018-04-23 21.03.49.png](https://qiita-image-store.s3.amazonaws.com/0/216208/e29b2cd4-a973-4b1a-8552-80c70f06804b.png)

はろーわーるど！！！


# おわりに
いろいろサイト巡って質問してみたんだけど、出始めのフレームワークなのでまずはjoinしている人が多いコミュニティの意見をいろいろ覗いてみるといいのかもしれません。

あと、2018/4/23時点なのでわりとすぐ直ってそうです。

# 追記(2018/04/30)
gemが修正されたようなので、おそらくすんなり動くと思います!!!
![スクリーンショット 2018-04-30 23.16.00.png](https://qiita-image-store.s3.amazonaws.com/0/216208/5ff18639-1e39-5c37-a295-3adba95e663c.png)


# 参照
[Hanami(旧:Lotus) - MicroservicesのためのRubyフレームワーク](https://qiita.com/takamario/items/d2eb6f43246c39145583)