Now that we have both RVM and Bundler, you’re following the advice in this article to keep all your gems in source control, right?
No? Why not? “I have a custom fork that isn’t on github?” Pfshaw!
1. Put a ‘:git’ option for the gem to your repo on disk. e.g:
gem ‘my_custom_gem’, ‘1.0.0’, :git=>’file://path/to/your/repo’
2. Follow the steps in the article:
bundle install —path vendor’
bundler package
Make sure the .gem for your custom gem is in vendor/cache.
3. Remove the :git flag for that gem in your Gemfile and run
bundle install —path vendor
again to remove the git references from Gemfile.lock.
4. Check in vendor/cache/*, and .bundle/config to source control.
There now, that wasn’t so hard. And now you don’t have to worry about losing the original git repo, or reinstalling the custom gem on every deploy.
-
mechazoidal posted this