Totally stumped

J

jenny w

[Note: parts of this message were removed to make it a legal post.]

Hi, everyone,
I'm have this issue where I'm using FreeTDS and unixODBC to connect to an
SQL Server database. The weird thing is that it works when I'm logged in,
running things from irb. However, if I start a process using cron, it
doesn't work. I've compared my PATH and $: in both environments and they're
the same ... are there any other things that might be different between the
cron environment and my login environment that may affect Ruby?

Thanks!

jw
 
J

James Britt

jenny said:
Hi, everyone,
I'm have this issue where I'm using FreeTDS and unixODBC to connect to an
SQL Server database. The weird thing is that it works when I'm logged in,
running things from irb. However, if I start a process using cron, it
doesn't work. I've compared my PATH and $: in both environments and they're
the same ... are there any other things that might be different between the
cron environment and my login environment that may affect Ruby?

What user is the cron task? What permissions?
 
J

jenny w

[Note: parts of this message were removed to make it a legal post.]

What user is the cron task? What permissions?

Same user is running cron. That's what makes this so perplexing. If I run
the job as that user from the command-line it works; if I run it through
cron as the same user, it doesn't. I get:

DBI::DatabaseError (IM002 (0) [unixODBC][Driver Manager]Data source name not
found, and no default driver specified):
/usr/local/lib/site_ruby/1.8/DBD/ODBC/ODBC.rb:96:in `connect'
/usr/local/lib/site_ruby/1.8/dbi/dbi.rb:584:in `connect'
/usr/local/lib/site_ruby/1.8/dbi/dbi.rb:384:in `connect'

Thanks!
 
J

jenny w

[Note: parts of this message were removed to make it a legal post.]

Ack! Just figured out that the problem happens outside of Ruby, too. Once I
realized I could reproduce the issue with isql, I realized I was missing the
FREETDSCONF environment variable. D'oh!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top