Forum: Ruby Re: Equivalent of Java static code block in Ruby?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1c1e3bdfe006a22214102fcd6434a012?d=identicon&s=25 Daniel Sheppard (Guest)
on 2006-04-12 01:57
(Received via mailing list)
If you're using fastcgi/webrick/mongrel (not plain cgi) and your
RAILS_ENV is set to "production" (which, by default will set the class
loading mechanism to 'require' rather than 'load'), you should get the
code only executed once (at least that's my understanding).

In general, if you're asking questions about how to do something in a
rails environment, mention that, as much of the behaviour seen in rails
is quite different from that in a standard ruby application (which is
what you'll find most of the answers in relation to).
This topic is locked and can not be replied to.