# Can't get rails working

**URL:** <https://www.ruby-forum.com/t/cant-get-rails-working/58540>\
**Category:** Rails\
**Created:** [April 22, 2006, 9:46pm UTC](https://www.ruby-forum.com/t/cant-get-rails-working/58540 "2006-04-22T21:46:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![markbates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@markbates](https://www.ruby-forum.com/u/markbates)\
**Post date:** [April 22, 2006, 9:46pm UTC](https://www.ruby-forum.com/t/cant-get-rails-working/58540/1 "2006-04-22T21:46:58Z")

</div>

I am trying to set up rails and am having problems. I have googled  
everything I could think of, but have not found my problem. Here are my  
specs.

Gentoo Linux 2006.0  
Apache 2.2  
Ruby 1.8.4  
Gems 1.8  
Rails 1.1.2  
mod\_fcgid 1.08

When I try to access my test rails app through the webserver, I get the  
following error in the error.log (after seeing a html 500 error on the  
page).

[Fri Apr 14 19:54:48 2006] [notice] mod\_fcgid: server  
/var/www/rails/cookbook/public/dispatch.fcgi(20039) started  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:123:in  
`const_missing': uninitialized constant RailsFCGIHandler (NameError) from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in`const\_missing’  
from /var/www/rails/cookbook/public/dispatch.fcgi:25

I have seen suggestions to run ‘ruby dispatch.fcgi’ from the command  
line, but I get the same error.

Any suggestions?

ps. I installed everything the WiKi said.

Apache  
mod\_fcgid  
fcgi  
gems  
ruby  
rails gem  
fcgi gem

---

<div class="post-metadata">

**Author:** ![markbates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@markbates](https://www.ruby-forum.com/u/markbates)\
**Post date:** [April 22, 2006, 10:17pm UTC](https://www.ruby-forum.com/t/cant-get-rails-working/58540/2 "2006-04-22T22:17:05Z")

</div>

If you are just starting out developing with rails I would suggest use  
webrick instead of apache, then move to apache when your application is  
ready to be hosted for production. That way you don’t have to mess with  
configuring apache to play nice until you are already familiar with  
rails  
itself. To run webrick just do: ruby script/server from your app’s root  
then you should be able to get to it at [http://localhost:3000/](http://localhost:3000/)

Rob

---

<div class="post-metadata">

**Author:** ![markbates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@markbates](https://www.ruby-forum.com/u/markbates)\
**Post date:** [April 23, 2006, 5:58pm UTC](https://www.ruby-forum.com/t/cant-get-rails-working/58540/3 "2006-04-23T17:58:59Z")

</div>

Rob M. wrote:

> If you are just starting out developing with rails I would suggest use  
> webrick instead of apache, then move to apache when your application is  
> ready to be hosted for production. That way you don’t have to mess with  
> configuring apache to play nice until you are already familiar with  
> rails  
> itself. To run webrick just do: ruby script/server from your app’s root  
> then you should be able to get to it at [http://localhost:3000/](http://localhost:3000/)
> 
> Rob

Thanks for your advice, but we are looking at using Rails for a  
commercial app we are developing. If I can’t get it to work, there is  
no point in using it.

---

<div class="post-metadata">

**Author:** ![markbates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@markbates](https://www.ruby-forum.com/u/markbates)\
**Post date:** [April 23, 2006, 8:19pm UTC](https://www.ruby-forum.com/t/cant-get-rails-working/58540/4 "2006-04-23T20:19:04Z")

</div>

Yeah, but you are obviously not familiar with rails so that is why I’m  
saying during development use webrick then move to apache when you are  
ready  
to host. That way when you get these kinds of errors by then you should  
know at least where to start looking for the solution.

my $0.02

Rob

---

<div class="post-metadata">

**Author:** ![markbates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@markbates](https://www.ruby-forum.com/u/markbates)\
**Post date:** [April 24, 2006, 1:45pm UTC](https://www.ruby-forum.com/t/cant-get-rails-working/58540/5 "2006-04-24T13:45:54Z")

</div>

Rob M. wrote:

> Yeah, but you are obviously not familiar with rails so that is why I’m  
> saying during development use webrick then move to apache when you are  
> ready  
> to host. That way when you get these kinds of errors by then you should  
> know at least where to start looking for the solution.
> 
> my $0.02
> 
> Rob

What happens when I spend 4 months learning Rails and then I still can’t  
get it set up and still get non-answers. Yes it is obvious that I am  
not yet familiar with Rails and I appreciate your point of view, but I  
don’t want to waste time I can’t afford to waste if I can’t get it set  
up at all.

---

<div class="post-metadata">

**Author:** ![markbates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@markbates](https://www.ruby-forum.com/u/markbates)\
**Post date:** [April 24, 2006, 1:49pm UTC](https://www.ruby-forum.com/t/cant-get-rails-working/58540/6 "2006-04-24T13:49:56Z")

</div>

Matt R. wrote:

> I agree completely. Work with webrick in development, then when you  
> start  
> getting errors you know what to do and where to look.
> 
> But sadly, I don’t know enough about Apache (I don’t deal with hosting  
> at  
> the moment) so I can’t help with your problem.
> 
> Good luck 🙂

It is not a programming error. I just followed the tutorial for setting  
up cookbook. I only went to the first step of setting up the the  
recipes table in MySQL and adding the scaffold to the controller. It  
works under WebRick, but it throws that error when trying to run it  
under Apache.

---

<div class="post-metadata">

**Author:** ![markbates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@markbates](https://www.ruby-forum.com/u/markbates)\
**Post date:** [April 23, 2006, 11:55pm UTC](https://www.ruby-forum.com/t/cant-get-rails-working/58540/7 "2006-04-23T23:55:52Z")

</div>

I agree completely. Work with webrick in development, then when you  
start  
getting errors you know what to do and where to look.

But sadly, I don’t know enough about Apache (I don’t deal with hosting  
at  
the moment) so I can’t help with your problem.

Good luck 🙂

---

<div class="post-metadata">

**Author:** ![markbates](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@markbates](https://www.ruby-forum.com/u/markbates)\
**Post date:** [April 24, 2006, 2:57pm UTC](https://www.ruby-forum.com/t/cant-get-rails-working/58540/8 "2006-04-24T14:57:23Z")

</div>

There is nothing special about configuring Apache with FCGI for a Rails  
app. FastCGI is a bit of a hassle but no chance is involved. It’s just a  
matter of getting some libraries and a module installed and putting the  
right six or seven lines in your configs. For me the most time-consuming  
part was finding a version of Apache (out of 1.3, 2.0, 2.1 and 2.2) for  
which one of the three or so available FastCGI modules compiled out of  
the box. In my case, under FreeBSD, that was a post-January 2006 rev of  
Apache 2.0.x and mod\_fastcgi.

Please remember that when you see a lot of messages on this list from  
people having problems, you’re seeing the ones having problems and that  
a majority of these people come in knowing little or nothing about  
configuring Apache so as they try to copy and paste from other people’s  
HOWTOs, they don’t understand what they’re pasting in and can’t grasp  
what they need to change for their own circumstances. You’re not seeing  
the thousands of people who spent an hour downloading things, fiddled  
with configs for a bit and got it all working before lunch. When you  
understand that your app’s root is in public/ and how and when  
dispatch.fcgi gets called, the rest will just be a matter of installig  
the module and setting some paths.

Nobody who understands Apache config files, the layout of their  
machine’s filesystem, how to install apps from packages and tarballs on  
their OS, and the importance of file permissions is going to fail to get  
Rails running properly on Apache. It may take a half-hour or it may take  
most of a day, but it installs and works fine and there’s nothing  
remotely insurmountable, magical or chancy about it. Once you do get it  
going, you slap your forehead, understand what you were doing wrong, and  
getting your second, third and fourth Rails apps running on Apache takes  
five minutes. It can just be a steep learning curve for people used to  
the one package and two lines of configuration needed to get PHP  
running.

And in any event, if Apache configs are too scary, that’s why Lighttpd  
was invented. Start developing, don’t think about Apache too much, and  
when you’re ready to start experimenting with deployment to production,  
study the config file examples for Rails on Apache and try to understand  
what they’re doing. _Then_ start downloading and installing things.

Mark Bernard wrote:

> Rob M. wrote:
> 
> > Yeah, but you are obviously not familiar with rails so that is why I’m  
> > saying during development use webrick then move to apache when you are  
> > ready  
> > to host. That way when you get these kinds of errors by then you should  
> > know at least where to start looking for the solution.
> > 
> > my $0.02
> > 
> > Rob
> 
> What happens when I spend 4 months learning Rails and then I still can’t  
> get it set up and still get non-answers. Yes it is obvious that I am  
> not yet familiar with Rails and I appreciate your point of view, but I  
> don’t want to waste time I can’t afford to waste if I can’t get it set  
> up at all.
