Displaying 20 results from an estimated 1000 matches similar to: "guru needed: connecting to a second (remote) db that may not be available"
2006 Jul 09
8
Can the has_many create() method return an ID?
Hi all,
I have a has_many relationship, Cookbook :has_many Recipes
If I want to create a new recipe in my cookbook I do:
cookbook.recipes.create(data)
It would be nice if I could then easily get the id of the new recipe,
but the create() method doesn''t seem to return anything. Any ideas how?
Thanks in advance!
Cameron
--
Posted via http://www.ruby-forum.com/.
2006 Jul 21
0
Webrick stops responding after extended inactivity.
Hello everyone,
I have developed several ruby apps which are currently live in
production. Recently I have encountered a problem where my apps stop
responding after a long period of inactivity. I am using Webrick as the
server with Rails 1.1.2 and mysql 5.0.21. I have dug up other issues
people have had with mysql dropping connections after 8 hours, and the
supposed fix of adding an
2007 May 10
1
Mongrel dying daily with Ruby 1.8.5
Dear ALL,
I saw this in article from mongrel faq,
Q: Mongrel stops working if it''s left alone for a long time.
If you find that Mongrel stops working after a long idle time and you''re
using MySQL then you''re hitting a bug in the MySQL driver that doesn''t
properly timeout connections. What happens is the MySQL *server* side of the
connection times out and
2006 Jul 13
2
partial_counter
Hi,
i was wondering if there was any conventional way to find out (via the
partialname_counter, or any other way) which partial is the last in a
set of partials ( render :partial => ''name'', :collection =>
''@somethings'') so that i can display some kind of variable in the last
partial.
there''s got to be some neat way to do this?
(like setting
2006 Jul 12
6
Showing rows on a page
This is my first rails program and I?m having trouble figuring out how
to show rows on the page when there may not be rows in the database.
There are 3 tables, employees, cost_codes and timesheet, I will simplify
them when describing them later on.
When an employee logs in, I would like to pull up their timesheet, which
should consist of one row per cost code. So timesheet would look a
2006 Jul 19
6
ActiveRecord::RecordNotSaved - bizarre behaviour.
Hi. I get a RecordNotSaved exception when trying to create a user record.
The error:
User Columns (0.005930) SHOW FIELDS FROM users
SQL (0.000465) BEGIN
SQL (0.000466) COMMIT
ActiveRecord::RecordNotSaved (ActiveRecord::RecordNotSaved):
...
As you can see, there''s no INSERT SQL generated, which is the root cause
of the problem.
In my user model, I have the following
2006 Aug 18
1
controller is to app.rb ; view is to layout folder ; rjs template is to ??
any help with this analogy? i have an rjs template that goes along with a method
i have in application.rb and the functionality will be used from many diff
controllers (the method take a tag as param to accomplish some AJAX
acrobatics).. just trying to stay DRY here. is there no other way other than
sticking the same rjs template in each view folder that uses this functionality?
i guess i could do
2006 Apr 16
3
variable variables?
Hi everyone,
Does Ruby support variable variables like PHP
(http://www.php.net/manual/en/language.variables.variable.php)? Or do I have
to use eval, like
some_hash.each_pair{|key, pair|
eval "#{key} = #{value}"
}
Or is there some other way?
I''m actually trying to figure this out in order to use ez_where to create
its conditions from a hash, so if this isn''t even
2008 Jul 14
3
Mongrel freeze
Hi,
I have had trouble with mongrel freezing after a period of
inactivity. Following the advice from the mongrel FAQ, I added:
ActiveRecord::Base.verification_timeout = 14400
to my environment.rb file. Unfortunately, that registered a mongrel
error:
"uninitialized constant ActiveRecord (NameError)"
How do I overcome this one? I tried:
require ActiveRecord::Base
but that registered
2007 Sep 21
2
mysql storeconfigs needs mysql gem
Recently I started noticing that after running for a while
puppetmaster would freeze after a client called `freshness` which
would eventually result in the client getting a timeout and the client
dyeing. I tracked the freeze down to the call to
ActiveRecord::Base.verify_active_connections! in rails.rb on line 26.
After scouring the nets I finally found:
2006 Nov 16
3
Monrel Woes on Solaris x86
Greetings,
I need some help... please be gentle :-)
MY SETUP:
Solaris-X86, ruby-1.8.4, Apache-2.2.0, Mongrel-0.3.13.4, MySql-4.1.10a
I am using the typical setup with apache proxying request to mongrel
with mod_proxy_balancer. Currently, I am only running a single
instance of mongrel behind the proxy.
I am also using the following gems with this app:
capistrano (1.2.0)
daemons (1.0.2)
2007 Jun 12
0
"Broken Pipe" FAQ solution a bust
A bit about my environment.
Fedora Core 6
httpd 2.2.2
ruby (compiled) 1.8.5
gem 0.9.4
rails 1.2.3
ruby/mysql C library 0.2.6
mysql 5.0.27
interactive_timeout = 28800
wait_timeout = 28800
mongrel 1.0.1
I''ve had this experience in other environments with different versions
but this configuration is the most recent attempt I''ve made. I get the
"Broken Pipe" error after
2007 Mar 18
0
Performance Tuning Mysql and how mongrel is effected
As a follow up from my previous post, I am pondering some changes to my env.
I read that with AR I should change the verification timeout to be
lower than the MySQL db Interactive_timeout. Now, I have done some
performancing tuning to mysql in LAMP env''s but not RoR. MySQL typical
set the default interactive_timeout to 8hrs (28800) this has bitten me
a few times with sleeping processess
2007 Jul 26
0
mongrel cluster stop working after long idle time
Hi,
I have a ruby on rails website. Server configuration is:
1. Nginx
2. 4 mongrel clusters running on different ports.
After a long idle time few of the mongrel clusters stops responding. I
have set "ActiveRecord::Base.verification_timeout = 14400" in
environment.rb file, but still it''s not working.
On executing "lsof -i -P | grep CLOSE_WAIT" command, I usually
2008 Feb 07
0
Firewall closes database connections resulting in hung mongrel processes
There are actually two separate issues I am experiencing:
* A firewall between our app and database closes the connection behind
us after 30 mins
* After a period of inactivity oracle closes connections on us
Both of these issues prevent mongrel to respond because rails doesn''t
realize the connections have been terminated. Anyone experience
something similar in the past to offer some
2006 May 25
5
Application stops working over night: (Errno::EPIPE (Broken pipe)) is the error
I know this question gets asked a lot but I can''t seem to find the
answer when I search through the mailing list. First off here''s my set
up.
Cent OS 4.3
Apache 2.0
Fast CGI 2.4.0
Rails 1.1
Mysql 5.0
The app starts up fine, but every morning it refuses to start and gives
me the dreaded Application error untill I reload Apache. I thought my
database was timing out so I added
2006 Jul 12
12
pass hash as parameter
Hello,
How can I pass a hash as parameter from a template with url_for?
e.g. : if I have
test = { :a => "a", :b => "b" }
How can I pass that with my request? Is it possible to pass nested
hash''es to?
Right now,
url_for :action => :test, test
doesn''t seem to work.
Thank you,
--
2006 Mar 20
1
FileColumn question
Can someone please help me with this.
I have an Images table :-
create table images (
id integer unsigned not null auto_increment primary key,
image varchar(200) not null default ''''
)ENGINE=InnoDB default CHARSET=latin1;
And a car table :-
create table cars (
id integer unsigned not null auto_increment primary key,
user_id integer unsigned not null,
title varchar(100) not
2008 Nov 26
3
fckeditor_textarea
hi, i am currently using rails version 2.2.2.
and using fckeditor_textarea.
here is the code:
<%= fckeditor_textarea(:emailcontent,:body, {:toolbarSet => ''Basic'',
:width => ''100%'', :height => ''100%''}) %>
where emailcontent is the model(object) name,
and body is method.
but it''s not working,however
2008 Apr 10
4
mysql connection goe away
We are currntly running
mongrel v 1.1.4
mongrel_cluster 1.0.5
mysql gem 2.7.5 (built from source)
rails 2.0.2
ruby 1.8.6
mysql version 4.1 this is run on a remote server.
We are consistently getting
"ActiveRecord::StatementInvalid (Mysql::Error: MySQL server has gone
away: SELECT * FROM...."
errors.
When i then try and stop mongrel some (various) of the mongrels are in
error state