Heroku does not reflect the code of the locally edited gem.

Asked 2 years ago, Updated 2 years ago, 128 views

 bundle install -- path vendor/bundle

I edited the gemfile downloaded in and saved it over.

herokupush

However, editing is not reflected in the production environment.

How can I edit the gem and use it?

Additional information -------------

"Edit and use gem" does not mean "Edit Gemfile and use the desired gem, both locally and in the production environment", but rather edited the individual Gem that you have bundle installed.

ruby heroku rubygems

2022-09-30 19:40

1 Answers

It's a little hard to understand what you want to do and what you're having trouble with because the usage of terms is strange (excuse me).

  • bundle install is the command to install the Gem (Ruby's library) written in the Gemfile. (Gemfile is not downloaded.)
  • Editing and saving Gemfile means adding or changing the gem you want to use.
  • After changing Gemfile, try bundle install again.Otherwise, the gem will not be installed.
  • As far as I know, there is no heroku push command. Do you mean git push heroku master?
  • I'm not sure what happens when editing is not reflected in the production environment.Does it mean that there is an error in the production environment even though it was working properly locally (on my PC)?
  • Do you understand that "Edit and use a gem" means "I want to edit a Gemfile and use the desired gem, both locally and in the production environment"?

For now, I will list the general work procedures.Assume that Rails will run in Heroku.

I think it's also useful to review basic development procedures from scratch using sites like Rails tutorial.

If it still doesn't work as expected, please add the following:

  • Contents of the Gemfile before and after the change (specifically what gem did you add)?
  • Git push heroku master displays all the output
  • What is specific if it doesn't work (error screen, the part that is moving but xxx is different from the local part, etc.)
  • If you see the
  • error screen, add a stack trace of the error in herokurlogs.
  • If you have any information about the Internet that you are referring to during development, please add it as well. (I think I'm following the same procedure as this site, but it doesn't work, etc.)

By editing a gem, do you mean that you have rewritten the code for the gem?

If so, the local changes will not be reflected in Heroku.
This is because when you deploy to Heroku, it is newly downloaded from rubygems.org and so on.

If you want to change it on your own, fork the code of the desired gem into your github account, change the code, and push it to github.
In addition, Rails' Gemfile must be specified to use the gem in your github.

I think the content of this site is close to what I want.

http://higelog.brassworks.jp/?p=2212

However, I think Gem's fork is basically a last resort because of the problem of how to follow the original update.
So I try to avoid it as much as I can.


2022-09-30 19:40

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.