2

I'm new to aws and is learning how to write container commands. I found a good link here: AWS Elastic Beanstalk using PHP with Private Composer Repositories

Everything worked in the beginning. But, later, my elastic beamstalk started spitting out this error

Command failed on instance. Return code: 1 Output: Error occurred during build: Defaults script for command 11-move-priv-key failed .

I am checking my cfn-init.log, and it is showing

2014-04-24 17:16:33,577 [DEBUG] Running command 11-move-priv-key
2014-04-24 17:16:33,578 [DEBUG] Generating defaults for command 11-move-priv-key
2014-04-24 17:16:33,595 [DEBUG] Defaults script for 11-move-priv-key output: 
2014-04-24 17:16:33,596 [ERROR] Defaults script failed for 11-move-priv-key: /opt/elasticbeanstalk/support/cfncontext.rb:3:in `require': no such file to load -- rubygems (LoadError)
    from /opt/elasticbeanstalk/support/cfncontext.rb:3:in `require': no such file to load -- rubygems (LoadError)
    from /opt/elasticbeanstalk/support/cfncontext.rb:3

So, rubygems was not installed, and ran yum install rubygems

Then, it said json for ruby wasn't installed and I decided to run gem install json and I get

Building native extensions.  This could take a while...
ERROR:  Error installing json:
    ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.8 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h

I'm new to aws and never used ruby before. So, I'm a bit baffled.

First, why did it work before and stopped working? Was there a setting that I accidentally changed?

Second, how do I fix json installation...

Thanks in advance!

Justin

Community
  • 1
  • 1
juworld
  • 140
  • 1
  • 15

0 Answers0