0

I'm trying to install the github-pages ruby gem in an AWS Elastic Beanstalk app. According to the docs, to do this you add an .ebextentions/somename.config file that declares the package as a dependency. My packages.config looks like this:

packages:
  yum:
    ruby-devel: []
    zlib-devel: []
  rubygems:
    github-pages: []

The eb logs claim that the package was installed successfully.

2016-06-05 21:44:52,037 [INFO] Installing github-pages version None via gem
2016-06-05 21:45:30,360 [INFO] Gem installed: github-pages-None

But when I ssh into the instance the jekyll command isn't found:

[ec2-user@ip-***~]$ jekyll
-bash: jekyll: command not found

Also gem list | grep github returns nothing.


Why isn't the package being installed and what can I do to make it install?

Thanks

0

The easiest method of doing this is to use RVM. It manages Ruby and all its gems for you and it's easy to use. See this link for using it.

If you did not want to use that you will need to modify your PATH variables so it can find your gems. I have found this to be tedious and reverted to RVM, but here are the general steps.

You will need to find out where your gems are getting installed. If you did gem install ... the gems will be in ~/.gem/ruby/1.8/gems/bin, if you used sudo gem install ... the gems will be somewhere in /System/Library/Frameworks/Ruby.framework/Versions/1.8/Resources

You have to add this path to your PATH variable. Easiest way to do this is by running : echo 'PATH=$PATH:above/path/to/gems' >> ~/.bash_profile

  • I'm happy to use RVM but it's not clear to me how to fit that in with the elasticbeanstalk environment. Right now I'm defining it in a config file and elasticbeanstalk just installs it. Are you suggesting doing the rvm thing in a script? – BonsaiOak Jun 9 '16 at 23:32
  • Also, what makes you so sure that it's actually getting installed? See the last part of my question. – BonsaiOak Jun 9 '16 at 23:32
  • If the GEM install fails EB will roll back the changes. Are you getting rollback in logs no right so Gem is installed. Another thing is directly running jekyll as a bash command will never work till you perform the last part of my answer. And yes you have to do the RVM in a script – error2007s Jun 9 '16 at 23:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.