| Message: 96953 |
 |
BY: David Adler (dadler) DATE: 2011-09-04 17:58 SUBJECT: RE: New Windows 7 Ruby 1.9.2 Rails 3.1 ibm_db Hi Praveen, thank you for the quick response.
'rails new myapp -d ibm_db'
is definitely the way to go as it nicely fills in the database.yml file.
I copied over the ibm_db_adapter.rb from the ones associated with http://rubyforge.org/tracker/index.php?func=detail&aid=29275&group_id=2361&ati
d=9175 and made the patch but I'm not getting much further.
This is my arel\visitors\ibm_db.rb
module Arel
module Visitors
class IBM_DB < Arel::Visitors::ToSql
private
def visit_Arel_Nodes_Limit o
@connection.set_limit visit o.expr
""
#"FETCH FIRST #{visit o.expr} ROWS ONLY"
end
def visit_Arel_Nodes_Offset o
@connection.set_offset visit o.expr
""
#"OFFSET #{visit o.expr}"
end
end
end
end
These are the messages that I get for
@posts = Post.all
E:\dwacode\rails31\test4>rails server
=> Booting WEBrick
=> Rails 3.1.0 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-09-04 13:50:15] INFO WEBrick 1.3.1
[2011-09-04 13:50:15] INFO ruby 1.9.2 (2011-07-09) [i386-mingw32]
[2011-09-04 13:50:15] INFO WEBrick::HTTPServer#start: pid=2824 port=3000
d:/Ruby192/lib/ruby/gems/1.9.1/gems/ibm_db-2.5.6-x86-mingw32/lib/active_record/c
onnection_adapters/ibm_db_adapter.rb:2217: warning: Statement Prepare Failed: Γå
Ç┌╣Θ╖╕╥¼♠
Started GET "/posts" for 127.0.0.1 at 2011-09-04 13:50:33 -0400
DEPRECATION WARNING: Arel::Visitors::VISITORS is deprecated and will be removed.
Database adapters should define a visitor_for method which returns the appropri
ate visitor for the database. For example, MysqlAdapter.visitor_for(pool) return
s Arel::Visitors::MySQL.new(pool). (called from mon_synchronize at d:/Ruby192/li
b/ruby/1.9.1/monitor.rb:201)
Processing by PostsController#index as HTML
←[1m←[36mPost Load (2.0ms)←[0m ←[1mSELECT posts.* FROM posts ←[0m
RuntimeError: Failed to prepare sql SELECT posts.* FROM posts : SELECT posts.* F
ROM posts
Completed 500 Internal Server Error in 144ms
ActiveRecord::StatementInvalid (RuntimeError: Failed to prepare sql SELECT posts
.* FROM posts : SELECT posts.* FROM posts ):
app/controllers/posts_controller.rb:5:in `index' | |