ruby-on-railsnginxuriphusionuninitialized-constant

Rails 6 - Phusion error for uninitialized constant URI::Generic


I'm using rails 6.0.3.4, ruby 2.5.0 with nginx/1.18.0 (Ubuntu). Everything was fine until I did a new deploy (using capistrano) and suddenly I'm getting Could not spawn process for application /home/deploy/appname/current: The application encountered the following error: uninitialized constant URI::Generic (NameError).

I have required these in application.rb (also tested requiring in the model) with no luck:

require 'uri'
require "uri/generic"

At this point, I'm not sure what could be wrong.

Thanks in advance if anyone has any suggestions.


Solution

  • It seemed it was a bug between Rails and Ruby, so I upgraded my Rails to the current stable version as well as upgraded my ruby version.