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!):
> 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!):
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
On Jun 8, 12:02 am, Adrian Duyzer <adrianduy...@gmail.com> wrote:
> 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!):
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: