I played around with Rails on my laptop (running Linux + Apache + MySQL) and had no trouble getting the Getting Started with Rails tutorial to work locally. Now I'm trying the same thing at work on a remote Mac OS X + Apache server, and things aren't quite so rosy.
rails blog -d mysql to create a directory called
/Library/WebServer/Documents/mydirectory. The trouble is, if I go to
server.com/mydirectory/public, I get the
public/index.html in my browser. But, I don't get this file if I go to
server.com/mydirectory/. Instead, I get a 403 error. Also, when I:
script/generate controller home index
I am unable to view this file, whether I go to
server.com/mydirectory/home/index, or if I add a new line (
map.root :controller => "home") to
config/routes.rb and go to
Am I missing something really obvious about Apache and Rails?
Apache does not support Rails out of the box. You have to get mod_rails aka Passenger installed. Or, you could just use the server that comes with Rails, which is much easier (but not suitable for production). To do this, go to your directory and do
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki