简体   繁体   中英

rails 3.0 locked on webrick

I have been looking at similar questions for hours and no joy, I am at my wits end. I have followed so many docunents, guides, tutorials and everything else on how to use the mongrel server in rails 3.0+. I have installed the mongrel gem, and included it in my gem file, but I just get a huge stack trace.

I am trying this command:

rails server mongrel

But I have also tried rails script/server mongrel

rails server simply uses Webrick every time.

The reason why I am so desperate to use mongrel, is because I am currently going through Sitepoint book Simply Rails 2, and I have just generated a model and controller. The controller was generated with rails generate controller Stories index . It then says you can start the server and open up the address (for webrick http://localhost:3000 ) /stories and it will contain the makings of the app. BUt I have to go to stories/index in order to get the desired view. I am wondering if this is because they use mongrel and I use webrick. If this is something else then problem solved anyway.

To answer your question on the default route to your Stories controller, see this post:
Rails 3 - index action not loading by default on controller

You need edit the default route in your routes.rb file to automatically load the index action. It doesn't have anything to do with mongrel vs WEBrick, it's simply a routing configuration issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM