1

I'm trying to deploy on AWS a spree application. After setting up elastic-beanstalk and adding to my_project/.ebextensions/ this .config file

packages:
  yum:
    git-core: []
container_commands:
  bundle:
    command: "gem install bundle"
  assets:
    command: "bundle exec rake assets:precompile"
  db:
    command: "bundle exec rake db:migrate"
    leader_only: true

I use git aws.push to deploy my app, only to get this error message:

Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)

double-checking on my gem set, using bundle show rake gives me:

... /gems/rake-10.1.0

while looking at the logfile from AWS I find this error:

sh: git: command not found Git error: command `git clone 'https://github.com/spree/spree.git'

what am I doing wrong?

Miotsu
  • 1,776
  • 18
  • 30

1 Answers1

7

You'll need to ensure that git is installed on the server.

Try creating a file called:

.ebextensions/YOUR_APPLICATION_NAME.config

which contains

packages:
  yum:
    git: []

This will install git with yum as part of your deployment.

Another option is to use spree from a gem instead of sourcing it from git.

For more information, check out this article on the AWS Blog about deploying Ruby Applications to Elastic Beanstalk.

gmacdougall
  • 4,901
  • 1
  • 16
  • 21
  • That certainly helped. Thanks. More, I installed my gems in vendor/bundle AND precompile store/shared/_print.css – Miotsu Aug 16 '13 at 14:02
  • 1
    That works as long as you don't have any gems installed locally. This is a more comprehensive answer. http://stackoverflow.com/questions/13642171/elastic-beanstalk-ruby-rails-need-to-install-git-so-bundle-install-works-but-i – Carlos Cervantes Aug 17 '13 at 22:53