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-tool开发者_开发知识库s-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?
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.
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
/home/ubuntu/ec2tools/ec2-api-tools-1.3-46266/lib/ec2/amitools/bundlevol.rb (LoadError)
The first problem I had is that I had set the EC2_HOME
and EC2_AMITOOL_HOME
environmental variables to point to the old location of the ami-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 the ami-tools
package (under ubuntu actually ec2-ami-tools
). Then when I reinstalled ami-tools
package it was able to pick up the appropriate ruby version and everything seemed to now work.
apt-get remove ruby
apt-get remove ec2-ami-tools
apt-get install ec2-ami-tools
精彩评论