Amit Suroliya was correct. I was using HTTParty as well and it was working through Curl and Development but would crash in production. Because the HTTParty parameter is the literal URL (as a string), it has to be a flawless URL/URI (meaning no spaces). My bad URI
was as follows:
HTTParty.get("http://api.blahblahblah.com/v1/Boards/Search?&limit=79&query=#{query}&filter_date_from=1423353600")
Notice the interpolation query=#{query}"
So if query='Michelle Obama'
, notice space between Michelle
and Obama
. Because of interpolation, the HTTParty.get('string') it is incorrect.
Solution:
Replace all whitespaces within your string with +
, or you could use %20
.
I used query.gsub!(' ', '+')
For more info on whitespace in the URL check it out here: Spaces in URLs?