Symfony2 和 IvoryGoogleMapsBundle - “ivory_google_map”下无法识别的选项“api_key”

Symfony2 & IvoryGoogleMapsBundle - Unrecognized option “api_key” under “ivory_google_map”

我已经按照使用 Composer 的文档中的描述安装了 IvoryGoogleMapsBundle

$ composer require egeloen/google-map-bundle
$ composer require php-http/httplug-bundle

我在 AppKernel class:

中注册了捆绑包
public function registerBundles()
{
    $bundles = array(
        // ...
        new Ivory\GoogleMapBundle\IvoryGoogleMapBundle(),
        new Http\HttplugBundle\HttplugBundle()
    );

我在配置文件中描述了 api_key,如文档 here 中所示:

ivory_google_map:
    api_key: "%my_key%"

所以问题是我得到一个错误:

Unrecognized option "api_key" under "ivory_google_map"

但是当我没有在配置中描述 api_key 时,我在浏览器控制台中得到 MissingKeyMapError

顺便说一句,Bundle 没有 ApiHelperBuilder Class,我无法在控制器中设置 api_key

Symfony 版本:2.8,IvoryGoogleMapsBundle 版本:^2.2

文档中没有提到我可能遗漏的任何想法?

----------
  UPDATE
----------

我刚刚阅读了捆绑包创建者对问题的评论 here @Matteo 在下面的评论部分链接了我。在我关注的 dev-master 文档中,bundle 的安装无法正常工作... 运行 $ composer require egeloen/google-map-bundle 安装 2.2.1 版本的 Bundle,它不支持 api_key

不幸的是,我找不到安装 dev-master 版本的方法。 $ composer require egeloen/google-map-bundle dev-master 不起作用。它建议 ^2.0@dev 版本也不支持 api_key。如何安装 dev-master 版本?

最终 composer 下载了错误的版本。它必须下载 dev-master,但由于在我的 composer.json 中 minimum-stability 设置为 stable,它正在下载最新的稳定版本 ^2.2。要为单个包定义 minimum-stability,我必须修改 composer.json:

...
"egeloen/google-map": "^2.0@dev",
"egeloen/google-map-bundle": "dev-master",
...

现在我已经下载了 dev-master 版本,ivory_google_maps 下的 api_key 工作正常。