Not sure this is the right place to post such a question but I am new to Ruby on Rails and I can’t find an answer anywhere.
I have an application that runs on Ruby 1.9.2 and Rails 3.0.3 and I try to upgrade it to Ruby 3.0.0 and Rails 7.1.2.
I copied my old application to a new linux server on which I installed Ruby 3.0.0 and Rails 7.1.2 but when I run “rails server”, it throws me this error : uninitialized constant Tools (NameError)
The error is located in the file config/initializers/config.rb where I have this line of code : RESSOURCE = Tools.get_param
I found that I have a tools.rb file in my app/helpers directory and that inside this file I had the folllowing code :
class Tools def Tools.get_param () affichage = Hash.new fic =File.open("config/Ressource.txt",'r') fic.each_line do |ligne| #lecture ligne Ã ligne ligne = ligne.chomp word = ligne.split("|") #lecture de chaque mot d'une ligne affichage [word] = word end return affichage end
So it’s like my Tools helper wasn’t loaded at startup.