Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update from Rails console, changes lost after closing console #31

Open
rebase-master opened this issue Feb 28, 2018 · 1 comment

Comments

@rebase-master
Copy link

Hi,

I had to update the city-state gem to get the latest data. I ran CS.update from Rails console and checked the results. I got updated data but as soon as I close Rails console on Heroku, the changes were lost.

Am I missing a step here? Please provide some assistance ASAP.

Thank you.

@joemsak
Copy link

joemsak commented Mar 6, 2018

Same problem on heroku here. It will update my local rails server through rails console though.

So far my guess is that it doesn't have write permissions to the csv file, as I believe heroku only allows writing to tmp/, which is ephemeral and wouldn't work for this gem

@steady-daddy here is what I did to fix it for me on heroku due to unwritable directories

  • Forked the gem to my own github account
  • Checked out a new branch from master
  • Added the gem to my project's Gemfile with the path option specified to my cloned fork
  • Ran CS.update from rails console
  • Added, committed, and pushed the changes on my fork
  • Changed my Gemfile to grab from my branch on github (path won't work on heroku unless you bundle it in a project subdirectory of course, which I simply did not do for no particular reason)
  • Pushed to heroku, it now uses my branch on my fork which I can keep updated as needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants