Thanks for the info Matt. I followed Nick's suggestions and instructions and using JRuby is ending up being way easier than using ODBC with Ruby. I got a connection up and running after I realized a couple of things and I am right now playing with it. I was getting a weird error about IDENTITY but I think I just figured out how to fix it.
When I finish I'll post here what I hope will be an easy guide to using JRuby with SQL Server. On May 25, 10:07 pm, Matt Jones <[email protected]> wrote: > On May 25, 10:27 am, pepe <[email protected]> wrote: > > > > > On May 24, 8:06 pm, ct9a <[email protected]> wrote: > > > > guys, > > > > It's interesting. Did the post below solve the problem? > > > Not for me. I am still working on getting the connection working, > > although I have not spent too much time on it. I am using SQL Server > > 2005, though, and I know pretty much nothing about SQL Server so it's > > being a little bit of a learning curve to set this up. > > > So far I have installed DBI and activerecord-sqlserver-adapter > > (2.3.5). After I did that I tried to use mode ADO and got this: > > > NotImplementedError: Please use version 2.3.1 of the adapter for ADO > > connections. Future versions may support ADO.NET. > > > So I installed 2.3.1 instead and got this when starting the console > > (but it let me in): > > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/ > > connection_adapters/abstract/connection_specification.rb:76:in > > `establish_connection':RuntimeError: Please install the sqlserver > > adapter: `gem install activerecord-sqlserver-adapter` (no such file to > > load -- deprecated) > > > and this when trying to instantiate a new record for a table: > > > ActiveRecord::ConnectionNotEstablished: > > ActiveRecord::ConnectionNotEstablished from c:/ruby/lib/ruby/gems/1.8/ > > gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/ > > connection_pool.rb:326:in `retrieve_connection' > > > Seeing this amount of "success" I switched back to 2.3.5 and changed > > the mode to ODBC, but the DSN parameter gave me trouble. Now I think > > the DSN is OK (not sure, though): > > > dsn: Driver={SQL Server};Server=<server_name> > > > where <server_name> is the server name showing in the Connection > > Properties window off the DB Management application (Microsoft SQL > > Server Management Studio Express). > > > I think the DSN is OK because of the error I am getting now, which > > could indicate that I have passed the DSN problem but there is > > something else going on. Now starting the console gives no errors but > > I can't get to the tables (testing from the console with a 'Table.new' > > command): > > I just recently got a Rails 2.3.5 app up on SQL Server 2005 using ODBC > mode, and the DSN I ended up using was the name specified in the "Data > Sources" control panel as a system DSN. I also had no end of trouble > until I added the login info to the (supposedly optional) "Use this > username and password to connect to the DB for additional > configuration" [paraphrasing] area. > > There was also the mess from running 32-bit Ruby on Windows Server > 2008 - the regular control panel created a DSN that couldn't be seen > from Ruby. I *finally* found these directions: > > http://www.boche.net/blog/index.php/2009/11/21/create-a-32-bit-vcente... > > That pointed me to the 32-bit control panel I needed. Not exactly the > easiest launch in the world... > > --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

