views:

210

answers:

2

Hi,

I am writting a rake task that would connect to a legacy ORACLE database, get some 'issues' records from a helpdesk application, apply some transformation and store it in another database (Redmine).

The problem is that even though the script runs smoothly on Windows, it fails to run on RHEL 5. The library files are all installed on RHEL 5 and there are no connection errors as such. The script fails on a line '_issue.save' (where _issue is a model of type Issue 0n Redmine)!! There is no error (Just that _issue.save returns false). I've been stuck for the last 2 days on this one.

Any suggestions would be extremely helpful.

I am using Rails 2.1.2, Ruby 1.8.6 (patch level 111) and Rake 0.8.1

Thanks in advance.

A: 

I would create some tests and run them on the RHEL server to see where the issue is. I would use RSPEC, but test/unit can get you there as well.

Brad
+1  A: 

No errors, but save returns false means validation might have failed. You can output the validation errors like so:

_issue.errors.each_full { |msg| puts msg }

Here's a bit more info on the each_full method.

dbarker