3
votes

I have set up my aws environment succesfully. However i am having one probelem. In my Gemfile i have the following line:

gem 'activeadmin', :github => 'gregbell/active_admin'

When i do a git aws.push i can see the following error in the aws logs:

/usr/local/share/ruby/gems/2.0/gems/bundler-1.3.5/lib/bundler/source/git.rb:177:in `rescue in load_spec_files': git://github.com/gregbell/active_admin.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)

I was able to fix that problem by creating this file: .ebextensions/ruby.config

option_settings:
  - option_name: BUNDLE_DISABLE_SHARED_GEMS
    value: "1"
  - option_name: BUNDLE_PATH
    value: "vendor/bundle"

packages:
  yum:
    git: []

This packages everything into vendor/bundle and my app starts correctyl.

However I have two problems with this approach:

  1. It takes very long to deploy because it needs to install all gems every time
  2. I am not longer able to execute commands when I ssh into the EC2 instance. For example I have to start an rpush deamon. Locally this works with bundle exec rpush development but on EC2 this results in:

    bundle exec rpush /usr/local/share/ruby/gems/2.0/gems/bundler-1.3.5/lib/bundler.rb:284: warning: Insecure world writable dir /var/app/current/vendor/bundle/bin in PATH, mode 040777 git://github.com/gregbell/active_admin.git (at master) is not checked out. Please run bundle install

Is there an other way for installing the gems correctly and at the same time using the system gems? Or if that is not possible, how can I start rpush when the gems are bundled?

3
Similar to stackoverflow.com/questions/13642171/… Check some of the answers there.Tim Moore

3 Answers

0
votes

Update your Gemfile.lock (bundle install&& bundle update) in your local env. and push a commit with Gemfile and Gemfile.lock. Deploy to AWS again.

0
votes

Can you check if using gem 'activeadmin', 'git://github.com:gregbell/active_admin' in your Gemfile works for you?

You can also get faster deployments utilizing vendor/cache by following the instructions given here: http://blogs.aws.amazon.com/application-management/post/Tx2XVRWSS4E971S/Locally-Packaging-Gem-Dependencies-for-Ruby-Applications-in-Elastic-Beanstalk

-1
votes

What solved my problem: I modified the bundle install script and added the --deployment flag