简体   繁体   中英

Local Gem Causes Heroku Push to Fail

I have a Gem on my local machine that I declare in my Gem file like this:

group :assets do gem 'my_gem', path: "/Users/me/path/to/my_gem" end

This works great locally, but when I push to staging on Heroku, the build fails because the gem isn't available.

Currently I'm having to comment/uncomment this gem between deploys which is a real pain.

I've also tried adding it to my development group, but this doesn't help.

Why is Heroku looking for this gem?

Bundler always needs to resolve all of the gems in your Gemfile. You shouldn't commit a Gemfile that contains a local path.

Instead, push your gem to a git repository that is reachable from Heroku and point to that in your Gemfile.

For development, you can use a local path override: http://bundler.io/v1.3/git.html#local

you can try placing the gem in vendor/gems directory, create it if it doesn't exist.then in your Gemfile do like this:

gem 'rails_multisite', path: 'vendor/gems/rails_multisite'

and make sure you run bundle update so Heroku can Pickup the changes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM