Newbie question - verifying it works right

I’m running apache 1.x on os x tiger.

I installed RoR following this website:
http://www.tonyarnold.com/articles/2005/08/10/rolling-with-ruby-on-rails-on-mac-os-x-tiger-for-beginners

I’ve got apache set up to point to the right directoy, and the virtual
host is created properly (ie, i made a virtual directoy named
‘rails_dev’ to point to the public folder within the Rails installation)

So, when I put this in my URL:
http://rails_dev/index.html

I get the
“Congratulations, you’ve put Ruby on Rails!”

However, if I just put ‘http://rails_dev/’ I get:
Application error
Rails application failed to start properly"

And in my apache error log it has this:
mod_rewrite: maximum number of internal redirects reached. Assuming
configuration error. Use ‘RewriteOptions MaxRedirects’ to increase the
limit if neccessary.

Inside my .htaccess file I have this:
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteBase /test/

*note - I’ve used RewriteBase of rails_dev thinking it may have been
with the URL, but I still get the same error

Also, when I try to run dispatch.cgi, I recieve this error:
Routing Error
Recognition failed for “/dispatch.cgi”

Any ideas/help? Anything that someone needs that I didn’t provide? Let
me know, I’d really like to try developing in ror… but just getting
started (with any language) always seems like the biggest hurdle…heh

Thanks in advance!
Tyler

tyler,
not sure why http://rails_dev/ points you to rails, but I think you
maybe getting “recognition for dispatch.CGI” because you have a
rewrite rule only for dispatch.FCGI

hope this helps (i’m a newbie too)

  • Oliver

2005/11/24, tyler craft [email protected]:

thanks for the response.

I should have explained more. My current setup is that I have a number
of virtual hosts set up with apache. so for instance, i manage a
website freeformfilm.org. I have set up a virtual host called
freeformfilm_dev which points to /Users/tyler/Sites/freeformfilm/dev/

This way I don’t have to keep doing localhost/freeformfilm/dev/ to get
to the site, and in my files, if I start a path with /, I wouldn’t go to
localhost, but rather the root of the dev folder. Although from the
.htaccess file that Rails made, it looks like I could have done this in
that file with the RewriteBase… but that is another topic…

I’ve made (what I think) is a little progress. I’ve cleared up the
rewrite issues.

So I have a virtual host set up for rails_dev to point to
/Users/tyler/Rails/Test/public/

When I go to this, the Rails welcome page comes up.

I even made a hello.cgi file with this that works:
#!/usr/bin/ruby
print “Content-type: text/html\r\n\r\n”
print “Hello World!\r\n”

I copied this file and made it hello.fcgi to see what would happen, but
my error log keeps coming back with this in an endless loop (or until I
restart apache):

[warn] FastCGI: (dynamic) server
“/Users/tyler/Rails/Test/public/hello.fcgi” restarted (pid 19339)

And when I tried to open the dispatch.cgi I get this in the browser:
Routing Error

Recognition failed for “/dispatch.cgi”

Perhaps I just haven’t got my head around how ror works. Should I even
be concerned about this? Or since the .cgi file worked… that just
means I have Ruby working right, but not Rails?

Again, thanks for the response.

tyler craft wrote:
[…]

Any ideas/help? Anything that someone needs that I didn’t provide? Let
me know, I’d really like to try developing in ror… but just getting
started (with any language) always seems like the biggest hurdle…heh

For learning Rails on OS X, Locomotive [1] + TextMate [2] is a great
combination. Don’t worry about hooking up to Apache until you really
need to.

regards

Justin

[1] http://locomotive.sourceforge.net/
[2] http://www.macromates.com/