Saturday, September 15, 2012

[Rails] Rails 3.2.6 hates dbi gem ?

I have a bad problem

I have a small rails app .. was running fine with ruby 1.8x and rails
2.x
In my extreme stupidity I decided to move to ruby 1.9.x and rails 3 ..
and it's a glorious pain.

My ruby app uses mysql .. and I use active record for that.
However there is an earlier pgm I had written to fill in the database
before I did rails (2x) which is part of the complete application now.
( I can test/run the standalone pgm outside rails and there is no
problem .. it works)

This standalone program in using mysql and dbi gems
I call this program as such from a model

system("ruby standalonepgm.ruby -args ")

In rails 2.0 this worked without any issue.
In 3.0 the program exits without any way to capture the error.


Running under console I see that the program dies because it can't find
dbi gem!

If I put dbi gem in the Gemfile and do bundle date but then there is
real trouble.
Rails refuse to start - "rails server" dies with all kind of issues ..
I can put in the screendump ..
but that's unimportant I think.

There seem to be 2 issues
1. DBI is surely incompatible with the gods of rails
2. Rails creates a sandbox .. and all programs called must live in that
sandbox (that's why just a require statement doesn't suffice).

My question is .. is it fixable or I am one of those who got bitten by
the hidden black magic of rails .. and my past 8+ weeks of effort is
down the tubes ?

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate