Forum: Ruby on Rails how ruby script/server work

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.
7220ba46014bac99a2ac1188c66c7656?d=identicon&s=25 mahmoud_cs (Guest)
on 2008-11-12 19:14
(Received via mailing list)
how ruby script/server exactly work in rails?
D69d23d8e811e8ab2a8593380d6ede63?d=identicon&s=25 Jeff Emminger (jemminger)
on 2008-11-12 21:07
(Received via mailing list)
read the source.

script/server loads the Rails environment boot file:
  require File.dirname(__FILE__) + '/../config/boot'

then requires a file from the Rails gem:
  require 'commands/server'

locate your rails gem install and read server.rb, should be in
  ruby/lib/gems/1.8/gems/rails-x.x.x/lib/commands/server.rb
4954715b1fb1a61ba31b700542402599?d=identicon&s=25 mafloria (Guest)
on 2008-11-28 16:18
(Received via mailing list)
I'm develop an application. I have rails 2.2 but when I want to see
changes in my application (by reloading) I have to restart the server.

What i need to do for do not restart??
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-11-28 16:34
(Received via mailing list)
On Nov 28, 3:18 pm, mafloria <margareth.flor...@gmail.com> wrote:
> I'm develop an application. I have rails 2.2 but when I want to see
> changes in my application (by reloading) I have to restart the server.
>
> What i need to do for do not restart??
>

Assuming you are running in development mode and that you haven't
fiddled with the config.cache_classes settings, one way of messing up
auto reloading is by using require to require stuff that rails is
capable of loading automatically.

Fred
4954715b1fb1a61ba31b700542402599?d=identicon&s=25 Margareth Florián (Guest)
on 2008-12-01 16:52
(Received via mailing list)
Thanks for your answer Fred..

I am in development environment, I have config.cache_classes =* false*
(in
my development.rb file)
In the environment.rb file i have require
File.join(File.dirname(*__FILE__*
), 'boot').
I try  by instancing load_once_path:
Dependencies.load_once_path?(RAILS_ROOT)
in my environment.rb
But does not work. I am not an ruby expert.

Can you explain me what can I do?

Thank you very much.
Margareth

2008/11/28 Frederick Cheung <frederick.cheung@gmail.com>
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-12-01 17:07
(Received via mailing list)
On 1 Dec 2008, at 15:51, Margareth Florián wrote:

> Thanks for your answer Fred..
>
> I am in development environment, I have config.cache_classes = false
> (in my development.rb file)
> In the environment.rb file i have require
> File.join(File.dirname(__FILE__), 'boot').
>

> I try  by instancing load_once_path: Dependencies.load_once_path?
> (RAILS_ROOT) in my environment.rb
> But does not work. I am not an ruby expert.
>

If you are using require to load any of your application's classes,
then don't

Fred
4954715b1fb1a61ba31b700542402599?d=identicon&s=25 Margareth Florián (Guest)
on 2008-12-02 22:43
(Received via mailing list)
Hi Fred.. Know the ruby code reload without restart the server but views
do
not.

2008/12/1 Frederick Cheung <frederick.cheung@gmail.com>
This topic is locked and can not be replied to.