4

我是亚马逊网络服务的新手,我正在尝试使用命令行界面工具在亚马逊弹性地图减少作业上运行作业流程。

我遵循了来自 aws 的这个开发者指南的亚马逊开发者指南中的步骤。但是事情对我来说并不清楚。

如果我执行命令./elastic-mapreduce --list 列出作业流程。显示以下错误。

/home/pdurai/Applications/elastic-mapreduce-cli/amazon/coral/httpdestinationhandler.rb:23: warning: else without rescue is useless
/usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': /home/pdurai/Applications/elastic-mapreduce-cli/amazon/coral/httpdestinationhandler.rb:19: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' (SyntaxError)
/home/pdurai/Applications/elastic-mapreduce-cli/amazon/coral/httpdestinationhandler.rb:36: syntax error, unexpected keyword_end, expecting $end
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/pdurai/Applications/elastic-mapreduce-cli/amazon/coral/awsquery.rb:6:in `<top (required)>'
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/pdurai/Applications/elastic-mapreduce-cli/amazon/coral/service.rb:8:in `<top (required)>'
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/pdurai/Applications/elastic-mapreduce-cli/amazon/coral/elasticmapreduceclient.rb:6:in `<top (required)>'
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/pdurai/Applications/elastic-mapreduce-cli/client.rb:6:in `<top (required)>'
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/pdurai/Applications/elastic-mapreduce-cli/commands.rb:7:in `<top (required)>'
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/pdurai/Applications/elastic-mapreduce-cli/elastic-mapreduce-cli.rb:5:in `<top (required)>'
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from ./elastic-mapreduce:6:in `<main>'

提前致谢,谁能告诉我为什么在列出工作流程时出现上述错误。

4

4 回答 4

4

使用以下命令检查可用的 rvm

   $ rvm list

它会显示:

   ruby-1.8.7-p374
   ruby-2.0.0-p247

那么您应该使用以下命令指定 rvm 版本

   $ rvm use 1.8.7

然后你可以尝试列出工作流。. .

于 2013-07-27T10:45:09.093 回答
2

如果rvm对您不起作用,您可以尝试更改Current符号链接:

cd /System/Library/Frameworks/Ruby.framework/Versions
sudo rm Current
sudo ln -s 1.8 Current

您可能需要调整第三个参数以指向正确的版本。

于 2013-11-08T19:20:33.253 回答
1

我建议首先使用服务控制台学习如何执行该过程。

您的命令行工具似乎无法正确连接。也许这是您的 access_key 和 secret_key 的问题。

于 2013-07-21T14:24:40.977 回答
0

作为@sasikkumar 的答案,但使用 rbenv

   $ rbenv versions

它会显示:

   1.8.7-p370
   * 1.9.3-p194 (set by /PATH_NEEDED/.ruby-version)

(可选)如果没有出现 1.8.7-p370

   $ rbenv install 1.8.7-p370

那么您应该使用以下命令指定 rbenv 版本

   $ rbenv local 1.8.7-p370

local因为它将用于 PATH_NEEDED 但您可以global用于一般用途)

然后你可以尝试列出工作流。. .

于 2014-04-14T19:42:17.287 回答