Scott
Scott

Reputation: 675

Custom Ruby Gem in Gemfile on Heroku

I've modified a Gem that I use in my Rails app, and need to use it on Heroku. Is there a way to upload the modified Gem to Heroku within my app and specify a custom path in my Gemfile?

Upvotes: 13

Views: 3812

Answers (4)

fuzzyalej
fuzzyalej

Reputation: 5973

in Gemfile: gem 'blah', :git => 'https://github.com/XXX/YYY.git'

Upvotes: 9

Michael
Michael

Reputation: 1139

You can set up a custom gem server like Geminabox. Unfortunately, it is designed for a LAN and has no built-in authentication. You can protect it via Rack::Auth middleware or use Rack::Mount to attach it to a secret path. If that's too tedious, you can use a private gem hosting service like Gemfury (disclaimer: I work on this service). Once you have either of those set up, just add the following to your Gemfile:

source 'https://custom-gem-server.com/secret-token/'

Upvotes: 1

iafonov
iafonov

Reputation: 5192

  1. Fork it on github
  2. Point your application to your modified gem using :git option when specifying gem dependency in Gemfile

Upvotes: 8

NARKOZ
NARKOZ

Reputation: 27911

You can place custom gems in the vendor directory and then specify them in your Gemfile:

gem 'gemname', '1.0', :path => 'vendor/gemname'

Upvotes: 22

Related Questions