 |
Forums |
Admin Start New Thread
By: Alex Pitigoi
RE: Cannot see contents of rows [ reply ] 2007-11-21 20:33
|
FYI:
IBM_DB-0.9.1 gem refresh is now available and fixes the VC80 runtime compatibility on Windows platforms (i.e. "LoadError: 14001: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail" or "LoadError: 14001: This application has failed to start because the application configuration is incorrect.")
|
By: Martin Connolly
RE: Cannot see contents of rows [ reply ] 2007-10-28 19:06
|
Alex, OK so I gave up with 0.9.0 and reinstalled 0.8.0. I still get the error message after the irb command but a rake db:migrate works. But after doing a scaffold I get the same problem - after clicking "New item" I get a page that says "New item", then just has a "create" button and the "back" link - no text field for the "name" column. I'm going to uninstall ruby and rails and start again I think. I reckon something has got nastily messed up somewhere. Will be right back....
Martin
|
By: Martin Connolly
RE: Cannot see contents of rows [ reply ] 2007-10-28 18:53
|
Alex, I get this after uninstalling 0.8 and reinstalling 0.9
C:\ruby\bin>gem list ibm_db
*** LOCAL GEMS ***
ibm_db (0.9.0)
Rails Driver and Adapter for IBM Data Servers: {LUW, zOS, i5, IDS}
C:\ruby\bin>irb
irb(main):001:0> require 'mswin32/ibm_db'
LoadError: no such file to load -- mswin32/ibm_db
from (irb):1:in `require'
from (irb):1
irb(main):002:0>
Have I got an environment problem here?
Thanks
|
By: Alex Pitigoi
RE: Cannot see contents of rows [ reply ] 2007-10-26 15:47
|
Oups, I missed your most important question: the connection configuration should look similar to:
development:
adapter: ibm_db
database: railsdb
username: userid
password: secret
schema: newapp
host: db2box.domain.com
port: 50000
Note: if schema is not provided, then the userid is used as default schema, but that might cause conflicts.
|
By: Alex Pitigoi
RE: Cannot see contents of rows [ reply ] 2007-10-26 15:21
|
Martin, regarding 0.9.0 can you try this:
D:\>gem uninstall ibm_db
Select gem to uninstall:
1. ibm_db-0.8.0-mswin32
2. ibm_db-0.9.0-mswin32
3. All versions
> 3
Successfully uninstalled ibm_db version 0.8.0
Successfully uninstalled ibm_db version 0.9.0
D:\>gem install ibm_db
Need to update 49 gems from http://gems.rubyforge.org
.................................................
complete
Select which gem to install for your platform (i386-mswin32)
1. ibm_db 0.9.0 (ruby)
2. ibm_db 0.9.0 (mswin32)
3. ibm_db 0.8.0 (mswin32)
4. ibm_db 0.8.0 (ruby)
5. Skip this gem
6. Cancel installation
> 2
Successfully installed ibm_db-0.9.0-mswin32
D:\>gem list ibm_db
*** LOCAL GEMS ***
ibm_db (0.9.0)
Rails Driver and Adapter for IBM Data Servers: {LUW, zOS, i5, IDS}
D:\>irb
irb(main):001:0> require 'mswin32/ibm_db'
=> true
irb(main):002:0> conn = IBM_DB::connect 'DRIVER={IBM DB2 ODBC DRIVER};DATABASE=railsdb;HOSTNAME=bilbao.torolab.ibm.com;PORT=50000;PROTOCOL=TCPIP;UID=userid;PWD=pass;', '', ''
=> #<IBM_DB::Connection:0x2d9725c>
irb(main):003:0> stmt = IBM_DB::exec conn, 'select schemaname from syscat.schemata'
=> #<IBM_DB::Statement:0x2d93814>
irb(main):005:0> while schemas = IBM_DB::fetch_assoc(stmt)
irb(main):006:1> p schemas
irb(main):007:1> end
P.S. adapter working correctly against remote database should definitely not be a surprise (see full connection string above)... it's meant to :-) ...even for DB2 on i5 and z/OS or Informix IDS
Further, I attempted to recreate your test environment, only using IBM DS Driver for ODBC and CLI 9.1 FP3 (instead of DB2 ESW 9.1 FP3). You can get it here:
ftp://ftp.software.ibm.com/ps/products/db2/fixes2/english-us/db2_v91/clidriver/fp3
D:\>db2level
DB21085I Instance "DB2" uses "32" bits and DB2 code release "SQL09013" with level identifier "01040107".
Informational tokens are "DB2 v9.1.300.257", "s070719", "WR21392", and Fix Pack "3".
Product is installed at "D:\clidriver" with DB2 Copy Name "IBM DB2 Driver for ODBC and CLI".
D:\TMP>rails newapp
D:\TMP>rails newapp
D:\TMP>cd newapp
D:\TMP\newapp>ruby script/generate model item name:string
D:\TMP\newapp>rake db:migrate
(in D:/TMP/newapp)
== CreateItems: migrating =====================================================
-- create_table(:items)
-> 1.9840s
== CreateItems: migrated (2.0000s) ============================================
D:\TMP\newapp>ruby script/generate scaffold item
D:\TMP\newapp>ruby script\server
Then I accessed http://localhost:3000/items/ and create 2 rows without much problem.
Something else is probably different between our environments, and we just need to find out what that is...
|
By: Martin Connolly
RE: Cannot see contents of rows [ reply ] 2007-10-26 14:46
|
Alex, it didn't fix the "ibm_db driver failed to load" problem. I went back to 0.8 because of that and now get this error with displaying data.
Thanks
BTW changing tablespace made no difference.
I added two rows - names set to "Martin" and "Alex", plus another column "job". The activescaffold edit function now says "updating Martin" but does not show anything else.
Interestingly I can get the adapter to work correctly against a remote database!
|
By: Alex Pitigoi
RE: Cannot see contents of rows [ reply ] 2007-10-26 14:38
|
Hmm, are you saying you just run that vcredist_x86.exe which installed "Microsoft Visual C++ 2005 Redistributable" on your win32 machine, and you still have problems running IBM_DB-0.9.0 ??
... or that did not fix your IBM_DB-0.8.0 problems in the Rails app? (which was not supposed to fix)
I shall recreate your environment in the meantime...
|
By: Martin Connolly
RE: Cannot see contents of rows [ reply ] 2007-10-26 14:33
|
Alex, thanks for the quick reply. I tried the VC++ fix but nothing changed....
Anyway, my schema is really simple - the table is called items and I have 2 columns - id and name. id is an integer and name is a varchar 50. I can't see any errors logged in the console (using Aptana). I did set this table up to use a non-default table space however...I'll try using the default and see what happens.
How do I specify the schema in database.yml?
Thanks
|
By: Alex Pitigoi
RE: Cannot see contents of rows [ reply ] 2007-10-26 14:22
|
Hi Martin,
First, the problem you are experiencing with IBM_DB-0.9.0 is known and answered on another thread ("Upgrade to IBM_DB 0.9.0"): libraries built with VS2005 and Visual C++ 8.0 (VC80) require a Microsoft Visual C++ 2005 Redistributable package to provide backward compatibility for VC80 runtime.
Just download Microsoft fix from below and install as any Service Pack:
http://www.microsoft.com/downloads/details.aspx?familyid=32bc1bee-a3f9-4c13-9c99-220b62a191ee&displaylang=en
For your issues with IBM_DB-0.8.0 inside a Rails application we certainly need more details about your DB2 database schema, but even more important any SQL error that might have been logged by the Rails application. Also, a schema required in the database.yml (mysql probably does not require).
Please let us know what is the actual error exhibited so we can investigate the root cause.
Thanks,
Alex
|
By: Martin Connolly
Cannot see contents of rows [ reply ] 2007-10-26 13:56
|
|
I'm using ibm_db 0.8.0 mswin32 - Windows XP SP2, with DB2 ESW 9.1 FP3. (0.9.0 would not load so I had to go back to 0.8. Anyway...) I have the same database replicated in mysql5 and DB2. If I point my database.yml at the mysql database, I can see the contents of rows in my rails app (I'm using active scaffold but plain old scaffolds have the same effect). If I point it at DB2, then I get the right number of rows returned, but no data shows up within the rows, and editing/creating just gets me a blank form with no data entry options. Any ideas anyone? Thanks
|
|
 |