Home > Enterprise >  uninitialized class variable @@schemes in URI
uninitialized class variable @@schemes in URI

Time:09-03

I am trying to migrate schemas but when I do the following logs are shown :

$ rails db:migrate
rails aborted!
NameError: uninitialized class variable @@schemes in URI
Did you mean?  scheme_list
D:/Projects/lms-2021/config/application.rb:3:in `require'
D:/Projects/lms-2021/config/application.rb:3:in `<top (required)>'
D:/Projects/lms-2021/Rakefile:4:in `require_relative'
D:/Projects/lms-2021/Rakefile:4:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<main>'
(See full trace by running task with --trace)

how to fix this?

  • windows 10 pro
  • git bash terminal
  • rails v 5.1.7
  • ruby v 3.1.2

CodePudding user response:

It would be great if you could share the code of your migration that you're running and the code of URI as well. Apparently, the class variable @@schemes in URI is not initialized.

you can initialize it using (or equals) || =

for example, if @@schemes is an array you can do something like that:

@@schemes ||= []

CodePudding user response:

For those who don't read comments... installing or updating(if not installed) gem 'globalid' helped for me.

add gem 'globalid', '~> 1.0' and then bundle install

  • Related