require 'sqlite3' gives pragma.rb syntax errors -Ruby 1.9.2, windows
all I have in the file is :
require 'rubygems'
require 'sqlite3'
if I just run that, I get this stacktrace....(top part for brevity...) C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.1-x86-mswin32/lib/sqlite3/pragmas.rb:70: warning: else without rescue is useless :29:in `require': C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.1-x86-mswin32/lib/sqlite3/pragmas.rb:57: syntax error, unexpected ':', expect开发者_如何学Pythoning keyword_then or ',' or ';' or '\n' (SyntaxError) when "on", "yes", "true", "y", "t": mode = "'ON'" ^
Any help would be appreciated. as an FYI, based on other posts I put the sqlite3 dll in Ruby\bin in vain.
Thanks!!
OK, so this may help someone in the future. I installed Ruby using the one-click installer, and it gave me sqlite3 but version sqlite3-ruby (1.2.1 mswin32). Due to some other tangential posting, I thought I will try to get the newest version as it appears that 1.9.2 does not support 1.2.1 of sqlite3. So I did a gem install sqlite3-ruby
again, and it installed 1.3.3 of sqlite3-ruby, and now my script works.
精彩评论