[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Totally stumped

jenny w

6/3/2008 12:48:00 AM

[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

3 Answers

James Britt

6/3/2008 1:10:00 AM

0

jenny w wrote:
> 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?


--
James Britt



jenny w

6/3/2008 2:43:00 AM

0

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

On Mon, Jun 2, 2008 at 6:10 PM, James Britt <james.britt@gmail.com> wrote:

>
> 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!

jenny w

6/3/2008 3:33:00 AM

0

[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!