Skip to main content

All Questions

0 votes
0 answers
5 views

Ruby (3.3.4) and Rails (7.1) - rails s Zeitwerk - uninitialized constant Utils::ScriptsUtils::Utils (NameError)

I am trying to update my ruby app from ruby 2.6.6 to ruby 3.3.4 and Rail 5.1 to Rails 7.1 I know it is not a good practice to do so, but in my case (which is a bit complicated) I felt I didn't have ...
bseido's user avatar
  • 11
0 votes
1 answer
43 views

Error loading .rb file in /lib after migration from rails 3 to rails 7

I have a very old application written with rails 3 and need to update it to current rails 7. I am stuck with a strange problem: in lib/assets there is a file tools.rb full of functions used across ...
kranz's user avatar
  • 611
5 votes
1 answer
150 views

Rails 7 way of auto-loading methods into controllers via engine

I'm looking into updating one of my favorite CMSs to Rails 7 that have been archived on github (PushType). Only I haven't coded Rails since Rails 6. Apparently, something about autoloading methods ...
Michael K Madison's user avatar
0 votes
0 answers
81 views

Naming conventions for rspec tests with zeitwerk expecting model_spec.rb to define constant ModalSpec

I'm working on upgrading rails, and part of that process involves switching from the classic autoloader to zeitwerk. I've been running bin/rails zeitwerk:check and handling all the cases that come up,...
Macpeters's user avatar
  • 116
0 votes
1 answer
96 views

Zeitwerk and extentions

I'm having some troubles with Zeitwerk when migrating to Rails 7. I got: # config/initializers/monkey_patches.rb:4 Dir[Rails.root.join('lib', 'extensions', '*.rb')].each { |f| require f } String....
brcebn's user avatar
  • 1,662
1 vote
2 answers
340 views

Rails 7.0 upgrade: Autoloading with Zeitwerk

Having trouble autoloading modules when upgrading from classic autoloader to now using zeitwerk. Currently my modules are as follows: # app/lib/configuration/test_configuration module ...
fev3r's user avatar
  • 105
0 votes
0 answers
265 views

How to tell Zeitwerk to ignore overrides folder in a rails engine?

In the latest Rails 7.1.2 my engines have stopped working with the following error Zeitwerk::NameError: expected file /home/jamie/Development/rails/comtech/r7/ccs_cms/engines/admin_dashboard/app/...
jamesc's user avatar
  • 12.8k
0 votes
1 answer
208 views

Rails admin with zeitwerk

Hi i am having a application built in rails 6 and i am trying to update it to rails 7 but there's some problem i am facing with zeitwerk. in the rails admin initilizer # initilizer/rails_admin.rb ...
Prateek Vyas's user avatar
1 vote
0 answers
19 views

Adding a administrate gem gives Zeitwerk error

I am getting a error Error: expected file /Users/luqman/Desktop/Checkout/jcom .app/app/dashboards/sessions_dashboard.rb to define constant SessionsDashboard, but didn't When I try to run rails g ...
Burhan Gardezi's user avatar
1 vote
1 answer
2k views

NameError (uninitialized constant Error) in Rails 7

I recently upgraded my rails application to rails 7 and after upgrading when I try to call the call from the lib folder I am getting this error NameError (uninitialized constant Error) I have ...
Ghanshyam Anand's user avatar
0 votes
1 answer
96 views

Rails Zeitwerk loads modules 'partial'? ie. my Module calls 'extend OtherModule', but the rest of the module in the file is ignored

Intro: I am migrating my application from Rails 3.2.x to Rails 7.0.4.2. I am much more far already, than I expected. Although I am a zeitwerk noob, I like that approach - especially the "no ...
halfbit's user avatar
  • 3,881
0 votes
1 answer
381 views

Upgrading Rails, how to autoload constants before config/environment/devlopment.rb runs?

I'm new to Ruby and Rails, so please forgive me if this is a n00b question. I'm trying to upgrade a very old app (using Ruby 2.3.4 and Rails 5.0.6) to the latest versions of Ruby (3.1.3) and Rails (7....
athome withagroovebox's user avatar
2 votes
1 answer
2k views

Zeitwerk not autoloading models in rails 7

I recently upgraded my Rails version of my application from 6.1 to 7 and I am facing one issue with zeitwerk. I was also using the zeitwerk in my rails 6.1 which was working fine but suddenly ...
Dev V's user avatar
  • 125
1 vote
2 answers
4k views

Zeitwerk::NameError due to Module name in rails 7

I recently upgraded my application from rails 6 to 7 and I am facing one issue due to zeitwerk naming convention. I have a below file which I want to autoload: app/models/dw/hospital.rb module DW ...
Dev V's user avatar
  • 125
5 votes
2 answers
6k views

rails 7 zietwerk constants not found

I'm upgrading our app from rails 6 to 7, I was using zeitwerk instead of the classic autoloader with rails 6 without any issues, now without any changes to the folder/file naming convention or ...
Subash's user avatar
  • 3,158