app is not reloading in development mode

46 views
Skip to first unread message

Adrian Duyzer

unread,
Jun 8, 2009, 12:02:43 AM6/8/09
to sinatrarb
My development version of Sinatra seems to be running in production
mode even when I am in development mode, developing locally, as
changes to my app file are not reflected until I restart the
application.

I know that I am in development mode because it starts with this
message:

== Sinatra/0.9.2 has taken the stage on 4567 for development with
backup from Mongrel

I have the simplest possible setup right now because I just started a
new project that has really nothing in it, just a single action (plus
the requires at the top):

get '/' do
haml :index
end

If I change haml :index to just:

"yo"

Nothing happens - my app continues to render index.haml. If I
restart, it renders the text "yo" as expected. The same thing happens
if I put garbage into the code that would normally cause the app to
fail to run, or if I put debugger statements in, etc.

This is for a little photo gallery I'm hacking together that I just
put up on Github so if you wish to review my code, by all means go
ahead (there's not much there!):

http://github.com/adriand/O/tree/master

I am running the latest gem versions of Sinatra, Haml, Rack and
Mongrel.

Blake Mizerany

unread,
Jun 10, 2009, 3:13:27 PM6/10/09
to sina...@googlegroups.com
Reloading is no longer supported in Sinatra.  

Please use/see shotgun:
--
Blake Mizerany
blake.m...@gmail.com

dusty

unread,
Jun 10, 2009, 10:12:30 PM6/10/09
to sinatrarb
I use rack reloader.

In my app:

module MyApp
class Reloader < Rack::Reloader
def safe_load(file, mtime, stderr = $stderr)
App.reset! if File.expand_path(file) == File.expand_path
(App.app_file)
super
end
end

class App < Sinatra::Application
configure :development do
use Reloader
end
end

end

Alex Chaffee

unread,
Jun 16, 2009, 1:46:25 PM6/16/09
to sina...@googlegroups.com
On Wed, Jun 10, 2009 at 12:13 PM, Blake
Mizerany<blake.m...@gmail.com> wrote:
> Reloading is no longer supported in Sinatra.
> Please use/see shotgun:
> http://github.com/rtomayko/shotgun

Or rerun! :-)

http://github.com/alexch/rerun

IndianGuru

unread,
Jun 16, 2009, 11:57:18 PM6/16/09
to sinatrarb
I installed rerun on Windows by -

E:\>gem install rerun
Successfully installed rerun-0.2.1
1 gem installed
Installing ri documentation for rerun-0.2.1...
Installing RDoc documentation for rerun-0.2.1...
E:\>

My simple Sinatra file (myapp.rb) is -

# myapp.rb
require 'sinatra'
get '/' do
'Hello'
end

When I type the following to run this app, I get -

E:\sinatra_programs>rerun myapp.rb
E:/ruby/lib/ruby/gems/1.8/gems/rerun-0.2.1/lib/system.rb:7:
uninitialized constant MissingSourceFile (NameError)
from e:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `gem_original_require'
from e:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `require'
from e:/ruby/lib/ruby/gems/1.8/gems/rerun-0.2.1/lib/rerun.rb:1
from e:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `gem_original_require'
from e:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `require'
from e:/ruby/lib/ruby/gems/1.8/gems/rerun-0.2.1/bin/rerun:48
from e:/ruby/bin/rerun:19:in `load'
from e:/ruby/bin/rerun:19
E:\sinatra_programs>

What am I doing wrong? All help appreciated. Thanks.

Satish

On Jun 16, 10:46 pm, Alex Chaffee <ale...@gmail.com> wrote:
> On Wed, Jun 10, 2009 at 12:13 PM, Blake
>

Alex Chaffee

unread,
Jun 17, 2009, 2:49:40 PM6/17/09
to sina...@googlegroups.com, satish...@gmail.com
> What am I doing wrong?

At this point, my only answer is: "Using Windows." :-)

I'll look into it in more detail when I get access to a windows box.

- A

Alex Chaffee

unread,
Jun 24, 2009, 10:43:04 PM6/24/09
to sina...@googlegroups.com, satish...@gmail.com
On Wed, Jun 17, 2009 at 11:49 AM, Alex Chaffee <ale...@gmail.com> wrote:
> What am I doing wrong?

At this point, my only answer is: "Using Windows." :-)

I'll look into it in more detail when I get access to a windows box.

As I feared, the Windows version of Ruby does not support "fork" so Rerun won't work on that platform. I'll update the docs to make that clear.

 - A
Reply all
Reply to author
Forward
0 new messages