开发者

Setting up local web server on Mac for Ruby on Rails

I use MAMP for PHP/MySQL.

What do I need for RoR?

I am using OS X Leopard. I have alr开发者_Python百科eady installed Ruby, Gems and Rails.


sudo gem install passenger will get you Phusion Passenger (mod_rails) which is pretty much the standard nowadays. There's a nice preference pane for managing the server on Mac OS X and a Railscast about it.

Alternatively, sudo gem install mongrel to use the Mongrel server which you run using the script/server command and access on port 3000. Rails includes the basic WEBrick server, but most developers use Mongrel or Passenger.


Ruby on rails has a builtin web server (Webrick)

so you have only to create a rails project:

rails your_project
cd your_project

and start the server:

script/server

edit: also you can use mongrel instead of webrick by simply installing the gem

(sudo) gem install mongrel 

if have a lot of apps that you want to run automatically at startup you sure can use Apache with Passenger (aka: mod_rack or mod_rails)

and the Passenger Pane may be useful (tnx fingertips)


You can simply run script/server to run a local web server for web development - there is no need to set up something like Apache. It will tell you the port it is listening at, and then you can just open that in your web browser.

You might want to install Mongrel (a faster Ruby server) by typing:

sudo gem install mongrel

Then script/server will use that instead of the default, WEBrick.

When deploying to production, you might be interested in something like Phusion Passenger, but it's much easier to develop applications using the built-in way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜