ec2_bundle_vol 失败并出现错误 LoadError
我是亚马逊 ec2 设置的新手。
我现在已经根据自己的喜好设置了一台机器 - 现在我想将其捆绑在一起。
我正在从启动的实例运行以下命令 -
root@domU-21-34-67-26-ED-Z4:~# ec2-bundle-vol -r i386 -d /mnt \
-p ACT-VOL -u 8940-1355-4155 -k /tmp/pk-key.pem \
-c /tmp/cert.pem -s 10240 \
-e /mnt,/root/.ssh,/home/ubuntu/.ssh
ruby: No such file or directory --
/home/ubuntu/ec2tools/ec2-api-tools-1.3-46266/lib/ec2/amitools/bundlevol.rb (LoadError)
ruby 版本是 1.8.7。我在网上搜索并安装了 libruby1.8-extras 等,但没有成功。我也尝试从 site_ruby (/usr/local/lib/site_ruby) 运行它 - 但没有用。
我尝试安装 1.8.6 版本的 ruby,但也找不到方法。
任何帮助将不胜感激。
谢谢, K
编辑:还有一个问题是:我应该在本地计算机中运行此命令还是应该在启动的实例中运行此命令?
I am a newbie in amazon ec2 setup.
I have now setup a machine to my taste - and I now want to bundle it.
I am running the following command from the launched instance -
root@domU-21-34-67-26-ED-Z4:~# ec2-bundle-vol -r i386 -d /mnt \
-p ACT-VOL -u 8940-1355-4155 -k /tmp/pk-key.pem \
-c /tmp/cert.pem -s 10240 \
-e /mnt,/root/.ssh,/home/ubuntu/.ssh
ruby: No such file or directory --
/home/ubuntu/ec2tools/ec2-api-tools-1.3-46266/lib/ec2/amitools/bundlevol.rb (LoadError)
The ruby version is 1.8.7. I searched internet and installed libruby1.8-extras etc too, but to no avail. I also tried running it from site_ruby (/usr/local/lib/site_ruby) - but no use.
I tried installing 1.8.6 version of ruby, but was unable to find a way to do so too.
Any help would be much appreciated.
Thanks,
K
EDIT: One more question is : Should I be running this command in my local machine or should I run this command in the launched instance?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您遇到了一个恼人的问题,即 EC2 实例上默认未安装 EC2 AMI 工具。这些工具可通过此链接获取 - 只需下载并将它们解压缩到您启动的实例上,您应该可以开始了。
You've run into the annoying problem that the EC2 AMI tools aren't installed by default on an EC2 instance. The tools are available via this link - just download and unzip them onto your launched instance and you should be good to go.
直接从 AMI 工具(而不是 API 工具)的 bin 目录运行脚本。
对于 ec2-bundle-vol 命令,主路径也必须设置为 AMI-tools 路径
run the script directly from the bin directory in your AMI-tools, NOT in API-tools.
the home path must be set to the AMI-tools path too for the ec2-bundle-vol command
我遇到的第一个问题是我设置了
EC2_HOME
和 < code>EC2_AMITOOL_HOME 环境变量指向/opt
中ami-tools
的旧位置。从我的脚本和环境中删除这些导出,一切都工作得更好。最初我还以为是ruby版本不兼容的问题。
我的解决方案是卸载
juby
版本并卸载ami-tools
软件包(在 ubuntu 下实际上是ec2-ami-tools< /代码>)。然后,当我重新安装 ami-tools 包时,它能够选择适当的 ruby 版本,并且现在一切似乎都可以工作。
The first problem I had is that I had set the
EC2_HOME
andEC2_AMITOOL_HOME
environmental variables to point to the old location of theami-tools
in/opt
. Removing those exports from my script and my environment and everything worked better.Initially I also thought it was a problem with an incompatible version of ruby.
The solution for me was to de-install the version of
juby
and to de-install theami-tools
package (under ubuntu actuallyec2-ami-tools
). Then when I reinstalledami-tools
package it was able to pick up the appropriate ruby version and everything seemed to now work.