My code uses the GHOST Api to call standard information for recent posts. I use it to list recent posts on my Rails homepage. So it calls things like: title, exceprt, image, url.
However, that is not the problem. My code works completely fine, and has done for many years.
My issue is that when I work locally on my development setup, I can’t display anything using GHOST. My homepage loads, but the Ghost section is always completely empty.
Since my code works on production, I’ve clearly got something setup incorrectly and was curious if there is something obvious I’ve missed.
To reiterate:
my code works in production env, not development env.
my development env variables for GHOST_URL and GHOST_SECRET are working, and are the exact same as production
I can use simple curl commands (with variables) from the local machine and access full JSON data which proves my app should work fine.
no warnings or issues listed in rails logs about errors.
ghost data just does not pass to view on local dev.
Depending on how you installed the dev version of Ghost, you probably need a different api key. Content imports don’t include api keys if I recall correctly.
But wait, you said it works with curl? I’ve got nothing then…
I am running curl from my local terminal (osx) to prove that there are no firewalls restricting me from accessing my production Ghost server, or any issues with my api ids. Always works fine and loads the expected json data.