2

I have been using Mongrel successfully with rails 2.* and 3.0* development, with ruby 1.8.7.

I recently started working with Rails 3.1 and ruby 1.9.2. I got my test app running with WEBrick. I don't like WEBrick. If I forget and simply close the WEBrick terminal window instead of going into the window and issuing a Control-C to WEBrick, the server port (3000) stays in use, and I can't run 'rails server' again until I log out everything and get WEBrick cleared out of the port table. Mongrel never had that problem.

I do have a build problem with Mongrel and ruby-1.9.2. I get multiple header files in the build, some referring to ruby-1.9.1 and some ruby-1.9.2. What a mess.

What is the recommended development web server for my config, which is 32-bit Ubuntu Natty with Rails 3.1 and ruby 1.9.2?

Kev
  • 118,037
  • 53
  • 300
  • 385
explainer
  • 1,345
  • 3
  • 11
  • 25
  • Do you actually want a solution for the WEBrick problem (this is what the answers are trying), for the Mongrel build problem (which would need more information), or a general "shopping recommendation" (which would be closed as not constructive)? – Paŭlo Ebermann Sep 22 '11 at 11:48

2 Answers2

1

Webrick works well for me. The only problem I had is that it did not work well with https secure. The solution was to only run https on staging and production, not on development machine.

I use the dev machine only as the server, and develop on Windows machine with Notepad++. I think it works well, after using a horrible Rails IDE. (I used to use Visual Studio and love it.) Access the web page through local IP and port. It's a cheap, fast easy solution for Windows users.

I am running Ubuntu 11.04, Rails 3.07, Ruby 1.92 with RVM, and PostgreSQL. RVM is supposed to make life easy for Ubuntu users, because Ubuntu uses a different version of Ruby.

To kill the server process running on port 3000: xxxx is the value returned from the first line.

$ lsof | grep 3000
$ kill -9 xxxx

This could easily be combined into one line or an alias killserver or similar.

B Seven
  • 44,484
  • 66
  • 240
  • 385
  • interesting, but excuse me, [my output is a list](https://gist.github.com/1234382), how would you easily put it in a script? – ecoologic Sep 22 '11 at 09:04
  • Interesting. My result is only 1 line. Are you running a remote desktop or something else on port 3000? – B Seven Sep 22 '11 at 13:50
  • I didn't know that command, I'm on the same machine of the server (ubuntu), after killing the server the list is still long... I'll try on my laptop tomorrow and I'll see. – ecoologic Sep 22 '11 at 15:59
  • `pkill` is much easier than what we're doing... and eventually it kills the console – ecoologic Sep 22 '11 at 16:01
0

Thanks for the various port listener kill commands, I will construct something simple to clear the WEBrick's irritating habit, and continue to use it. Chasing a development web server issue is low on my priority list; they should just work.

You can see from my questions that my Linux skills don't go very deep into the kernel.

explainer
  • 1,345
  • 3
  • 11
  • 25
  • I find it very useful to keep the window open to check the output. Especially if it is on a separate computer/monitor. – B Seven Sep 22 '11 at 16:51