Rails shows error "uninitialized constant URI::Generic"
Asked Answered
C

1

10

I'm using rails 5.2.3 with apache2 when I run the development server it shows no error but when I deploy it with passenger and apache2 server it shows this error

Error: uninitialized constant URI::Generic,
Colenecoleopteran answered 9/2, 2020 at 6:39 Comment(0)
G
14

add the first of file (config/application.rb) you can add this line

require 'uri'
Gittel answered 9/2, 2020 at 6:50 Comment(2)
Do you know this isn't automatically required?Catinacation
This also works in Rails 6.0.2.2 (ruby-2.5.0) after creating a new application with $ rails new blog and the step rails webpacker:install throws this issue (Error: uninitialized constant URI::Generic,). After implementing this fix, re-running the rails webpacker:install command will succeed.Bauhaus

© 2022 - 2024 — McMap. All rights reserved.