Setting up mongrel

okay, i have officially given up on:

apache with fastcgi
lighttpd with fastcgi

and now i am working on getting mongrel running…

not that i don’t think that the above two are viable options, i have
just spent more time trying to get this app live than i did actually
writing the app… and i need to have something working for beta
testing…

i installed mongrel according to:

http://mongrel.rubyforge.org/

and spent a little time reading this:

http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/

but found that i needed to take a look capistrano… which doesn’t look
terrible… but it means probably another few hours of goofing around
rather than getting something working for beta…

i have the app running on the remote server on webrick, and everything
seems to be running fine… so i don’t think that’s the problem…

when i try running it on mongrel, uising:

mongrel_rails start -d

i get the error tacked on to the end of this as a result…

i think i am just going to unroll this via webrick for test, so i can
have something to start with… but i would sure like to get on the road
with a production server…

any help would be greatly appreciated:

error is as follows:


Errno::ENOENT in LoggerController#index

No such file or directory - /tmp/mysql.sock
RAILS_ROOT: /home/sergio/railssites/chatlogger/config/…

Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/vendor/mysql.rb:104:in
initialize' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/vendor/mysql.rb:104:in real_connect’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:331:in
connect' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:88:in initialize’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:37:in
mysql_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:251:in connection_without_query_cache=’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/query_cache.rb:54:in
connection=' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in retrieve_connection’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
connection' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:696:in columns’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:1969:in
attributes_from_column_definition' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:1351:in initialize_without_callbacks’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/callbacks.rb:236:in
initialize' #{RAILS_ROOT}/app/controllers/logger_controller.rb:4:in index’
/usr/bin/mongrel_rails:18

On Tue, 2006-06-27 at 08:42 +0200, sergio ruiz wrote:

okay, i have officially given up on:

apache with fastcgi
lighttpd with fastcgi

and now i am working on getting mongrel running…

Another sucker uh convert. :slight_smile:

rather than getting something working for beta…

You don’t need capistrano, you can just do it via mongrel_cluster and
apache manually, then hit the capistrano later.

i have the app running on the remote server on webrick, and everything
seems to be running fine… so i don’t think that’s the problem…

when i try running it on mongrel, uising:

mongrel_rails start -d

i get the error tacked on to the end of this as a result…

You get this mysql error when you have your mysql in databases.yml
configured to use “localhost” but localhost isn’t resolvable for some
reason. Try changing to 127.0.0.1 and that should do it. Or, try
configuring to use the /tmp socket and make sure that mysql can use it
too.


Zed A. Shaw

http://mongrel.rubyforge.org/

You get this mysql error when you have your mysql in databases.yml
configured to use “localhost” but localhost isn’t resolvable for some
reason. Try changing to 127.0.0.1 and that should do it. Or, try
configuring to use the /tmp socket and make sure that mysql can use it
too.

i tried changing to 127.0.0.1, but that didn’t seem to do the trick…

from my.cnf:

socket=/var/lib/mysql/mysql.sock

should i change to the /tmp in my.cnf?

or where should i change it so that it works correctly?

this looks like i am on the right track…

also…

i am firing up mongrel by running:

mongrel_rails start -d

and doing a:

mongrel-rails restart

when things change drastically on the system…

is running this way good enough for basic beta testing?

will i run into other problems while i flesh out the rest of this whole
thing?

thanks!

On Tue, 2006-06-27 at 09:12 +0200, sergio ruiz wrote:

socket=/var/lib/mysql/mysql.sock

should i change to the /tmp in my.cnf?

Not quite sure, you may have to google around for it. I know there’s a
few answers to the general problem. Most likely that configuration is
in your mysql configuration, but probably not configured your
databases.yml to use the same socket.

i am firing up mongrel by running:

when things change drastically on the system…

is running this way good enough for basic beta testing?

Generally that’ll work, but if you’re doing dev work it’s just easier to
run with mongrel_rails start.

Also, did you know there’s a -G option which will generate a config file
to match the options you give? You run it once with -G mongrel.yml and
the options you need. And then just run mongrel_rails start -C
mongrel.yml. Very handy.

will i run into other problems while i flesh out the rest of this whole
thing?

Nope, but I’d say keep it simpler. Just do mongrel_rails start during
development, and then do little deployments by just running
mongrel_rails start -C and a config that puts it on a single port. Very
easy.


Zed A. Shaw

http://mongrel.rubyforge.org/

sergio ruiz wrote:

You get this mysql error when you have your mysql in databases.yml
configured to use “localhost” but localhost isn’t resolvable for some
reason. Try changing to 127.0.0.1 and that should do it. Or, try
configuring to use the /tmp socket and make sure that mysql can use it
too.

i tried changing to 127.0.0.1, but that didn’t seem to do the trick…

from my.cnf:

socket=/var/lib/mysql/mysql.sock

should i change to the /tmp in my.cnf?

I’d play it safe and change the database.yml to match what’s specified
in the my.cnf. Easier to mess with something thats ‘app’, than
something thats ‘system’ right now (since your main goal is getting up
and running).

Make sure you change the right entry in databse.yml. I assume you’re
going to be running production rather than development.

A.

should i change to the /tmp in my.cnf?

Not quite sure, you may have to google around for it. I know there’s a
few answers to the general problem. Most likely that configuration is
in your mysql configuration, but probably not configured your
databases.yml to use the same socket.

for the benefit of all the kiddies following this thread, i have
figgured it out… i think i was just sleep deprived last night…

here’s what i did…

inside database.yml,

i added this line:

socket: /var/lib/mysql/mysql.sock

to match the info from my.cnf…

fired up mongrel, and it works!

thanks, zed…