Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > rails on apache 2.0

Reply
Thread Tools

rails on apache 2.0

 
 
non
Guest
Posts: n/a
 
      07-17-2005
Working on the O'Reilly tutorial. Got everything working fine with WebBrick
and am not trying to get it to work with Apache.

I looks like I am close, ruby seems to be running, but I get the following
error when I open the /recipe/list page (or any other page accessing Mysql).

NameError in Recipe#list
uninitialized constant Mysql
/app/controllers/recipe_controller.rb:12:in `list'
Show framework trace
C:/opensource/ruby/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/dependencies.rb:186:in
`const_missing'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:37:in
`mysql_connection'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/query_cache.rb:52:in
`send'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/query_cache.rb:52:in
`connection='
C:/opensource/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/abstract_adapter.rb:108:in
`retrieve_connection'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:239:in
`connection'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:751:in
`add_limit!'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:746:in
`construct_finder_sql'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:343:in
`find'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/deprecated_finders.rb:37:in
`find_all'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in
`send'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in
`perform_action_without_filters'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in
`perform_action_without_benchmark'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in
`perform_action_without_rescue'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in
`measure'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in
`perform_action_without_rescue'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in
`perform_action'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in
`send'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in
`process'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in
`dispatch'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:144:in
`process_request'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:64:in
`process!'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:55:in
`each_cgi'
C:/opensource/ruby/lib/ruby/site_ruby/1.8/fcgi.rb:595:in `each'
C:/opensource/ruby/lib/ruby/site_ruby/1.8/fcgi.rb:595:in `each_cgi'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:55:in
`process!'
C:/opensource/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/fcgi_handler.rb:21:in
`process!'
D:/Projects/rails/cookbook/public/dispatch.fcgi:24
This error occured while loading the following files:
mysql.rb

Here is what I added to http.conf:

LoadModule fastcgi_module modules/mod_fastcgi.so

<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>

<VirtualHost *:80>
ServerName rails.todo.com
DocumentRoot d:/projects/rails/ToDo/public
<Directory d:/projects/rails/ToDo/public/>
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
</Directory>
</VirtualHost>

Here is what is in the .htaccess file:

# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain
requests
#
# Example:
# RewriteCond %{REQUEST_URI} ^/notrails.*
# RewriteRule .* - [L]

# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
#
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which will
be rendered instead
#
# Example:
# ErrorDocument 500 /500.html

ErrorDocument 500 "<h2>Application error</h2>Rails application failed to
start properly"

Any help would be appreciated.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Tomcat5.5 clustering problem with Apache HTTP server 2.2.4 tanmoy.b81 Java 0 02-04-2009 08:46 AM
Problems running Apache FOP: org.apache.fop.fo.FOTreeBuilder fatalError Pablo Java 0 03-28-2007 02:31 PM
org/apache/xpath/objects/XObject incompatible with org/apache/xpath/objects/XNodeSet duduch_1er@hotmail.com XML 4 08-10-2006 01:38 PM
Apache FileUpload - java.lang.NoClassDefFoundError: org/apache/commons/io/FileCleaner kebabkongen@hotmail.com Java 2 03-16-2006 09:20 AM
AXIS jars org.apache.axis.wsi.* and org.apache.axis.transport.jms.* unkwb@web.de Java 0 02-23-2005 04:02 PM



Advertisments