Things to know when replacing WEBrick by Thin
Asked Answered
O

2

8

I intend to replace WEBrick by Thin on a Rails 3.2 project because WEBrick handles malformed unescaped URIs badly (bad URI error). I know there are config hacks to make WEBrick handle unescaped URIs but just adding gem 'thin' to my Gemfile seems so easy that makes me wonder:

  • Is there something that could break or go wrong in my apllication if I do that?

BTW: I'm deploying on Heroku. If there are specific issues with Thin on Heroku then I would also like to know.

Osteitis answered 8/2, 2013 at 17:57 Comment(0)
C
6

Nope.. Rails is just that simple! :)

Just make sure you start using:

thin start
Chinaware answered 8/2, 2013 at 18:3 Comment(4)
For rails I'd get in the habit of doing: rails s thin. For production, things like Heroku do bundle exec rails s thin.Tarnetgaronne
Just made a quick test with Thin and strangely, it solves my bad URI problem in development but not in production with Heroku. And I'm sure Heroku has been restarted using Thin. Any ideas why this could happen?Osteitis
Check your production logs to make sure that the server started with thin.Chinaware
It is: === web: bundle exec thin start -R config.ru -e $RAILS_ENV -p $PORT web.1: up 2013/02/08 19:37:03 (~ 31m ago)Osteitis
E
7

If you have thin in your Gemfile rails s should start with thin. For example, the app I work on has thin in the development group in the Gemfile:

rails s
=> Booting Thin
=> Rails 3.2.14 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Estimation answered 2/10, 2013 at 11:27 Comment(0)
C
6

Nope.. Rails is just that simple! :)

Just make sure you start using:

thin start
Chinaware answered 8/2, 2013 at 18:3 Comment(4)
For rails I'd get in the habit of doing: rails s thin. For production, things like Heroku do bundle exec rails s thin.Tarnetgaronne
Just made a quick test with Thin and strangely, it solves my bad URI problem in development but not in production with Heroku. And I'm sure Heroku has been restarted using Thin. Any ideas why this could happen?Osteitis
Check your production logs to make sure that the server started with thin.Chinaware
It is: === web: bundle exec thin start -R config.ru -e $RAILS_ENV -p $PORT web.1: up 2013/02/08 19:37:03 (~ 31m ago)Osteitis

© 2022 - 2024 — McMap. All rights reserved.