2

After days of not being able to run a WEBrick rails server at all, I finally got it up and running only to have it shutdown about 5 seconds after it has started.

This is a completely fresh project created via the commandline. The only changes I made was in the gem file where I commented out a lot of gems, before I did that the server would not even run. Now it will run for a few seconds and then shutdown.

I am used to working with rails on mac and have never had this problem, but recently transitioned to windows and I am having a hard time identifying the exact problem.

If any of you have any ideas or suggestions to how I can resolve this, I would be very grateful

Here is a screengrab: What the error looks like, you can see that the server starts and then stops

Thanks

Peter

Luffen
  • 403
  • 1
  • 5
  • 17
  • Does this happen with a different server? (WEBrick should probably never be used for production, anyway). Does it work with Thin? Puma? GRHttp? Passenger? – Myst Jul 26 '15 at 11:16
  • @shilovk sorry that does not resolved it, have been all over previous posts with no luck :/ – Luffen Jul 26 '15 at 11:18
  • @myst not sure how to properly test with others, Webrick is only for testing right now, it is supposed to work out the box. Before it wouldn't even start, but now it actually starts and I don't think that it is WEbrick itself that is causing problems, but something else in the project – Luffen Jul 26 '15 at 11:20
  • `gem install thin` should be enough for thin (add to your gemfile). Both Rack & Rails adopt it as a default. Same goes for puma (`gem install puma`). GRHttp isn't a default, so you to need to both install (`gem install grhttp`) and also choose it (`ENV["RACK_HANDLER"] = 'grhttp'`) ... @shilovk raises a good point about the Rack version. Did you try running `bundle exec rails s`? – Myst Jul 26 '15 at 11:35
  • Just an observation. In the screen grab, the bundle that proceeds the launch of the Rails server is including a lot of gems that are not in the Gem file you show open in the editor window. – Elvn Jul 26 '15 at 16:34
  • @ValAsensio thanks for the input, though I think that is because of the dependencies of the gems in my file – Luffen Jul 27 '15 at 11:06
  • Glad you got the problem resolved. – Elvn Jul 27 '15 at 13:31

1 Answers1

3

How did you install ruby / rails ?

If you used the ruby installer from rubyinstaller.org, you can try using version 2.1.X (i see you are using 2.2.X right now), because these seem to be stable already:

If you don’t know what version to install and you’re getting started with Ruby, we recommend you use Ruby 2.1.X installers. These provide a stable language and a extensive list of packages (gems) that are compatible and updated.

You should also then consider using a 32 bit version, because they say 64 bit is quite new to windows:

The 64-bit versions of Ruby are relatively new on the Windows area and not all the packages have been updated to be compatible with it. To use this version you will require some knowledge about compilers and solving dependency issues, which might be too complicated if you just want to play with the language.


If you look over at railsinstaller.org, they are also using ruby 2.1.5 for their latest windows installer package.

SaSchu
  • 486
  • 5
  • 15