P
Paul Vudmaska
Setting up ruby,mod_ruby on a host we've got everything flying except
mysql with dbi.
[webmaster@iis webmaster]$ ruby -v
ruby 1.8.1 (2003-12-25) [i686-linux]
[webmaster@iis webmaster]$ ruby -e "p require 'mysql';require 'dbi'"
-e:1: warning: parenthesize argument(s) for future version
true
We've installed the latest and greatest of both dbi and mysql.
In a simple script, we can open the connection but as soon as i run sql
it dies - i mean i hangs or something....not even headers are being sent
back to the browser. Like so:
begin
require 'cgi'
cgi = CGI.new
cgi.header('content-type'=>'text/html')
require 'dbi'
puts 'before connect'
conn = DBI.connect("dbi:Mysql:dev:localhost",'name','pwd')
puts 'after connect'
#dies here - i've tried other sql as well with same result
r = conn.select_one('select version()')
#we never see this - or anything else
puts 'after sql'
puts <<-EoS
<html>
<body>
hello #{r[0]}
</body>
</html>
EoS
rescue Exception
puts $!
ensure
conn.disconnect if conn
end
No errors or nothing. No headers. IE, funky enough, gives me a dns
error. Anyone have a clue what I might be doing wrong?
Thanks for any help,
Paul
mysql with dbi.
[webmaster@iis webmaster]$ ruby -v
ruby 1.8.1 (2003-12-25) [i686-linux]
[webmaster@iis webmaster]$ ruby -e "p require 'mysql';require 'dbi'"
-e:1: warning: parenthesize argument(s) for future version
true
We've installed the latest and greatest of both dbi and mysql.
In a simple script, we can open the connection but as soon as i run sql
it dies - i mean i hangs or something....not even headers are being sent
back to the browser. Like so:
begin
require 'cgi'
cgi = CGI.new
cgi.header('content-type'=>'text/html')
require 'dbi'
puts 'before connect'
conn = DBI.connect("dbi:Mysql:dev:localhost",'name','pwd')
puts 'after connect'
#dies here - i've tried other sql as well with same result
r = conn.select_one('select version()')
#we never see this - or anything else
puts 'after sql'
puts <<-EoS
<html>
<body>
hello #{r[0]}
</body>
</html>
EoS
rescue Exception
puts $!
ensure
conn.disconnect if conn
end
No errors or nothing. No headers. IE, funky enough, gives me a dns
error. Anyone have a clue what I might be doing wrong?
Thanks for any help,
Paul