hallo there, i got a problem with switching from development- to production-mode in my rails project. in development everything is working fine, but in production i keep on getting a NameError... [quote] NameError in Appointments/admin/appointment categoryController#list uninitialized constant Appointments::Admin::AppointmentCategory /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:100:in `const_missing'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in `const_missing'' #{RAILS_ROOT}/app/controllers/appointments/admin/appointment_category_controller.rb:10:in `list'' /usr/bin/mongrel_rails:18 [/quote] why is that? has anyone got a clue what reason there could be for an error like that? maybe a problem with mongrel? in development i''m using the built-in webrick-server. for production i''m running mongrel on a debian 3.1 system. Debian Sarge 3.1 Rails 1.1.2 mongrel (0.3.13.3) mongrel_cluster (0.2.0) sendfile (0.9.2) lighttpd-1.4.11 thanks in advance for any replies! none -- Posted via http://www.ruby-forum.com/.
it''s me again, i found that it doesn''t change a thing if i run my rails app in production mode on a webrick-server on my home-machine (suse 10.1). so it''s NOT a mongrel/lighttpd related problem! seems like there a re problems with my models being nested in a subfolder. for example: [quote] class Downloads::Download < ActiveRecord::Base belongs_to :download_category end [/quote] why is this running perfectly in development-mode, but causing problems in production mode? and another couriousity: the first time i start my application, it is workinmg fine for 4 to 5 "clicks". after that the app hangs and dies with the posted error... why? -- Posted via http://www.ruby-forum.com/.
On Wed, 2006-07-19 at 18:11 +0200, none wrote:> it''s me again, > > i found that it doesn''t change a thing if i run my rails app in > production mode on a webrick-server on my home-machine (suse 10.1). so > it''s NOT a mongrel/lighttpd related problem! >Good.> seems like there a re problems with my models being nested in a > subfolder. for example: > [quote] > class Downloads::Download < ActiveRecord::Base > belongs_to :download_category > end > [/quote] >BOOM! Models in modules DO NOT WORK. I wasted about 3 weeks struggling with this on one team and it turned out nothing about it works. Putting controllers in modules is no problem, but Models just fails miserably and constantly. I''ve been rounds with rails-core over this misfeature, and the only response is that I''m a jerk so don''t expect it to improve soon. Apart from the above naming and loading errors, there''s also a logical error in how they''re implemented where if you have Downloads::Download then the table should match with downloads_downloads, other wise you have clashes when you have FooBar::Download in another module since they both use "downloads" as the table. You also have problems loading fixtures, naming fixtures, accessing two models with the same name, and many other problems. In other words, give up your foolish notion of putting everything in a module just like Java and embrace that you''ll have a monster model in the root namespace. You''ll be much happier. -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.railsmachine.com/ -- Need Mongrel support?
Zed Shaw wrote:> In other words, give up your foolish notion of putting everything in a > module just like Java and embrace that you''ll have a monster model in > the root namespace. You''ll be much happier.you got me there: i''m a java boy. or at least college tried to make me, before i discovered ruby. so thank you for your quick reply! i''ll take a look into it... -- Posted via http://www.ruby-forum.com/.