Elastic Beanstalk – Rails Deploy using Github Gems
I’ve read a couple of other threads on SO discussing using
:git in a GemFile but those solutions don’t seem to be working for me.
Here’s my .ebextensions/ruby.config file:
- Rails: exclude anything from version control?
- Good way of organizing git repository of multiple projects
- Excluding files from being deployed with Capistrano while still under version control with Git
- Setting git private repository project on jenkins server
- Can't push Rails app to Heroku
- Using Bundler with Git, is https:// or git:// better?
option_settings: - option_name: BUNDLE_DISABLE_SHARED_GEMS value: "1" - option_name: BUNDLE_PATH value: "vendor/bundle" packages: yum: git:  container_commands: 01bundle: command: bundle --deployment
Here’s the one place I’m using Github in my GemFile:
gem 'themes_for_rails', :git => 'https://github.com/digitalmoksha/themes_for_rails.git'
And finally, the error I get in production.log that is related to this gem not being here:
However, I can clearly see that the gems are packed in /var/log/eb-tools.log
Using themes_for_rails (0.5.2) from https://github.com/digitalmoksha/themes_for_rails.git (at master) Using turbolinks (1.3.0) Using uglifier (2.2.0) Your bundle is complete! It was installed into ./vendor/bundle
Here’s my full log file snapshot: https://gist.github.com/holtkampw/255d7bb00407fc615c76
Any ideas on what I can do to get this working correctly? Perhaps my .ebextenions file is incorrect?
2 Solutions collect form web for “Elastic Beanstalk – Rails Deploy using Github Gems”
This gist will make it behave as you would expect from most rails environments. I started using this in our deployments when I ran into the same problem with a gem sourced from a git repo.
From my understanding (at least as I recall), the rationale is that a git location is an untrusted source and could compromise or make your deployment unstable/not reproducible as instances are added/recycled. While I agree, I still want the option to use them when I want.
I had the same problem with active admin. You can put the gem into your vendor folder. Worked for me.
Put this in your gem file:
gem 'themes_for_rails', path: 'vendor/themes_for_rails', require: 'themes_for_rails'
You need to maintain this code into your /.ebextensions/ruby.config file:
option_settings: - option_name: BUNDLE_DISABLE_SHARED_GEMS value: "1" - option_name: BUNDLE_PATH value: "vendor/bundle"
Don’t forget to extract the git content of the gem into vendor/themes_for_rails folder.