1.9.2-rc2 -> 1.9.2-p0 breaks Sinatra

My Sinatra apps work with 1.9.2-rc2. After upgrading to 1.9.2-p0 they
terminate immediately (no output, exit status 0). Can anyone
reproduce this? I would appreciate help investigating this, as this
makes 1.9.2-p0 unusable for me.

Linux From Scratch 6.5, kernel 2.6.35.2
gcc version 4.4.1
glibc 2.10.1
Rack uses Thin as the server backend
All gems up to date as per this morning (2010/08/20)

Regards,

Jeremy H.

On Aug 20, 8:58 am, Jeremy H. [email protected] wrote:

Did you install and recompile all the gems from -rc2 to -p0 ?

Specially the ones dealing with Thin and EventManchine

removing those from the equation, your application still works?

Jeremy H. wrote:

My Sinatra apps work with 1.9.2-rc2. After upgrading to 1.9.2-p0 they
terminate immediately (no output, exit status 0). Can anyone
reproduce this? I would appreciate help investigating this, as this
makes 1.9.2-p0 unusable for me.

Sinatra’s behaviour has appeared to change in the 1.9 compatible
versions.

I need to add the following line in my server.rb:

set :run, true

Also the template directory is no longer implicitly ‘views’, you need to
set it yourself.

set :views, File.dirname(FILE) + “/views”

-Abhijit

On 2010-08-20, Luis L. [email protected] wrote:

On Aug 20, 8:58 am, Jeremy H. [email protected] wrote:

My Sinatra apps work with 1.9.2-rc2. After upgrading to 1.9.2-p0
they terminate immediately (no output, exit status 0).

Did you install and recompile all the gems from -rc2 to -p0 ?

No, because I never imagined that it might be necessary for an upgrade
from -rc2 to -p0 . But since you suggest it I have now tried removing
all of /usr/*/ruby, and re-installing ruby and all of my gems. No
change: all Sinatra apps terminate immediately, no output, exit status
0.

Specially the ones dealing with Thin and EventManchine

removing those from the equation, your application still works?

I uninstalled thin and eventmachine and it made no difference. I
assume the expectation was that the apps would fall back to the
webrick backend?

I ran “make check” and got one error (a Timeout) and “irb” runs OK, so
the Ruby core seems sound. Are there any other tests I could run?
Maybe something to check the Rack core? (I am afraid I know little
about Rack, I just use Sinatra and assume it will work.)

Has anyone managed to run Sinatra apps on 1.9.2-p0?

Regards,

Jeremy H.

On 2010-08-20, Abhijit H. [email protected] wrote:

set :views, File.dirname(FILE) + “/views”
Thanks! That was it! But why should Sinatra change its behaviour
between 1.9.2-rc2 → 1.9.2-p0? Any ideas? I would have said that the
definition of -rc is “behaviour won’t change when you upgrade to
-p”. Something, somewhere is doing it wrong.

Incidentally, the error message I get when I do not set the views
directory is very strange; Sinatra says:

                    Errno::ENOENT at /sinatra/index

No such file or directory -
[path to my Sinatra app
directory]/<internal:lib/rubygems/views/index.haml

 * file: tilt.rb
 * location: read
 * line: 122

[…]

It looks as though the template directory is being set to something
ridiculous, which suggests that setting it explicitly is really a
workaround for a bug.

I’ll see what the Sinatra devs say.

Thanks again for your help!

Jeremy H.

Jeremy H.:

Has anyone managed to run Sinatra apps on 1.9.2-p0?

Yes, I upgraded a (granted, trivial) Sinatra app from Ruby 1.9.1-p378 to
1.9.2-p0 and all I needed to cater for was the lack of the current dir
in $LOAD_PATH (but it shouldn’t matter if you ran 1.9.2-rc2 previously):

I’m affraid it’s a bit hard to tell what might be wrong without more
info. Can you come up with a minimal app that doesn’t work (and share
it with us)?

— Piotr S.

Abhijit H. wrote:

Sinatra’s behaviour has appeared to change in the 1.9 compatible
versions.

I need to add the following line in my server.rb:

set :run, true

Thank you very much this solved my problem also, executing sinatra code
had no output and nothing happened, after adding that line it started
working again.