When I try to run rake db:migrate I keep getting this error:
rake aborted!
no such file to load -- JSON
Has anyone else come across this problem, if so how did you solve it?
I have tried a lot of different things already. I tried adding the gem ‘json_pure’ to the Gemfile after doing some googling. I also tried checking out to previous branches that I know I was not getting this error. Kind of stuck now. Let me know if anyone can help me out.
The error is actually not happening on my friend’s mac. It is happening on Heroku and on my linux computer.
I had a play with irb:
So there is a ‘json’ module, but no ‘JSON’ module.
When a migration runs it pulls in most/all of your rails setup as well. If you have a
require 'JSON'somewhere in your code that you added into a module that hasn’t yet been tested.