I''m trying to connect to a SQLServer 2008 database running on localhost, but I can''t seem to get it working. Every time I try to run rake db:migrate I get an error telling me that I should install activerecord-sqlserver-adapter: I have tried to installe ther server-adapter with gem, but it doesn''t seems to be working properly. ***** $ rake db:migrate (in c:/Documents and Settings/mad/My Documents/Aptana Studio 3 Workspace/Musix) rake aborted! Please install the sqlserver adapter: `gem install activerecord-sqlserver-adapter` (no such file to load -- active_record/connection_adapters/sqlserver_adapter) (See full trace by running task with --trace) $ gem install activerecord-sqlserver-adapter Successfully installed activerecord-sqlserver-adapter-3.0.5 1 gem installed Installing ri documentation for activerecord-sqlserver-adapter-3.0.5... Installing RDoc documentation for activerecord-sqlserver-adapter-3.0.5... $ rake db:migrate (in c:/Documents and Settings/mad/My Documents/Aptana Studio 3 Workspace/Musix) rake aborted! Please install the sqlserver adapter: `gem install activerecord-sqlserver-adapter` (no such file to load -- active_record/connection_adapters/sqlserver_adapter) (See full trace by running task with --trace) -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I struggled with getting SQLServer to work with rails a couple years ago. I can''t speak to how easy or hard it is to do recently (sounds just as painful), but here are the steps for how I did it then...they might help. A note about step 2, at the time I used v0.1.0 of ruby- dbi. ADO.rb continued to be included up through v0.2.2 and ADO.rb from that version should still work but I think they stopped supporting ADO after that. I know these steps work with SQLServer 2005, I''m curious to know if this also works with 2008. Also, I seem to remember this only working with Ruby 1.8.6. I have since switched database systems and haven''t been motivated enough to figure out SQLServer with newer code. 1. Install SqlServer adapter gem activerecord-sqlserver-adapter (Only works with v1.0.0) 2. Download source distribution of Ruby-DBI from rubyforge.org/ projects/ruby-dbi/ (at the time, I used v0.1.0. -copy the file lib/dbd/ADO.rb to Ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ ADO.rb database.yml file format: development: adapter: sqlserver database: database_name host: server_name username: user_name password: password Hope this helps, Bob -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
murali dhararao
2010-Nov-02 16:03 UTC
Re: Re: Problem with Sqlserver and Rails on a Win XP
hi Bob, Go through this url this will be helpful for you. http://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Platform-Installation---Windows On Tue, Nov 2, 2010 at 8:40 PM, Bob <rpellien-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I struggled with getting SQLServer to work with rails a couple years > ago. I can''t speak to how easy or hard it is to do recently (sounds > just as painful), but here are the steps for how I did it then...they > might help. A note about step 2, at the time I used v0.1.0 of ruby- > dbi. ADO.rb continued to be included up through v0.2.2 and ADO.rb > from that version should still work but I think they stopped > supporting ADO after that. I know these steps work with SQLServer > 2005, I''m curious to know if this also works with 2008. Also, I seem > to remember this only working with Ruby 1.8.6. I have since switched > database systems and haven''t been motivated enough to figure out > SQLServer with newer code. > > 1. Install SqlServer adapter gem activerecord-sqlserver-adapter > (Only works with v1.0.0) > 2. Download source distribution of Ruby-DBI from rubyforge.org/ > projects/ruby-dbi/ (at the time, I used v0.1.0. > -copy the file lib/dbd/ADO.rb to > Ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ > ADO.rb > database.yml file format: > development: > adapter: sqlserver > database: database_name > host: server_name > username: user_name > password: password > > Hope this helps, > Bob > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- Thanks & Regards, MuraliDharaRao.T +91-9642234646 -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Nov-02 20:39 UTC
Re: Problem with Sqlserver and Rails on a Win XP
Magnus D. wrote in post #958686:> I''m trying to connect to a SQLServer 2008 database running on localhost, > but I can''t seem to get it working.Advice: do not use MS SQL Server with Rails. Do not do Rails development on Windows. Both of these will make your life harder.> > Every time I try to run rake db:migrate I get an error telling me that I > should install activerecord-sqlserver-adapter:[...] What does your database.yml file look like? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboDYtjvyW6yDsg@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser wrote in post #958814:> Magnus D. wrote in post #958686: >> I''m trying to connect to a SQLServer 2008 database running on localhost, >> but I can''t seem to get it working. > > Advice: do not use MS SQL Server with Rails. Do not do Rails > development on Windows. Both of these will make your life harder. >I''m starting to learn this. :)> > What does your database.yml file look like? >development: adapter: sqlserver mode: odbc dsn: dsn_name database: database_name I have a user dsn connected to the database. Thanks Magnus -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Nov-03 17:44 UTC
Re: Problem with Sqlserver and Rails on a Win XP
Magnus D. wrote in post #958933:> Marnen Laibow-Koser wrote in post #958814: >> Magnus D. wrote in post #958686: >>> I''m trying to connect to a SQLServer 2008 database running on localhost, >>> but I can''t seem to get it working. >> >> Advice: do not use MS SQL Server with Rails. Do not do Rails >> development on Windows. Both of these will make your life harder. >> > I''m starting to learn this. :) > >> >> What does your database.yml file look like? >> > > > development: > adapter: sqlserver > mode: odbc > dsn: dsn_name > database: database_name > > > I have a user dsn connected to the database.You neglected to specify user and password. Also, you''re using ODBC. I would recommend instead installing TinyTds and using mode: dblib. This allows Rails to make a direct TDS connection to your DB and bypass ODBC entirely.> > > Thanks > MagnusBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser wrote in post #959078:> Magnus D. wrote in post #958933: >> Marnen Laibow-Koser wrote in post #958814: >>> Magnus D. wrote in post #958686: >>>> I''m trying to connect to a SQLServer 2008 database running on localhost, >>>> but I can''t seem to get it working. >>> >>> Advice: do not use MS SQL Server with Rails. Do not do Rails >>> development on Windows. Both of these will make your life harder. >>> >> I''m starting to learn this. :) >> >>> >>> What does your database.yml file look like? >>> >> >> >> development: >> adapter: sqlserver >> mode: odbc >> dsn: dsn_name >> database: database_name >> >> >> I have a user dsn connected to the database. > You neglected to specify user and password.I have tried both with an User DSN and a File DSN, and the User DSN used the login on the system.> > Also, you''re using ODBC. I would recommend instead installing TinyTds > and using mode: dblib. This allows Rails to make a direct TDS > connection to your DB and bypass ODBC entirely.Can I use TinyTds on a Windowsbox? I thought it was Linux-only. Magnus -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Nov 2, 7:38 am, "Magnus D." <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I''m trying to connect to a SQLServer 2008 database running on localhost, > but I can''t seem to get it working.Hi Magnus, I am using MSSQL and like you I had lots of trouble making it work but I finally did get it to work. I am also using XP and here is my Ruby and Rails environment: ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] Rails 2.3.5 Here is a list of the steps I took from beginning to end. You might need to change/skip some of the steps. I hope it helps: 1. Install Ruby (1.8.6): http://www.ruby-lang.org/en/downloads/ 2. Install rubygems: a. http://rubygems.org/pages/download (zip version) b. Unpack to a directory and cd there c. ruby setup.rb 3. Install rails: gem install rails –v=2.3.5 4. Install mongrel: gem install mongrel 5. Install mongrel service: gem install mongrel_service 6. Install SQL Server adapter: gem install activerecord-sqlserver- adapter 7. Install ODBC gem: gem install odbc-rails 8. Install SQL Server Management utility (from Microsoft) 9. Create SQL Server DB (name ''give it a name here'') 10. Create login in SQL Server (''give it a name here'') 11. Create DB user (''give it a name here'') 12. Create DSN in Windows: a. Control Panel -> Adminstrative Tasks -> Data Sources (ODBC) b. Click on System DSN -> Add c. Select type SQL Server i. Name: ''give it a name here'' ii. Description: ''give it a name here'' iii. Server: Server name (i.e.: ''Whatever name the DB has under SQL Server Manangement here'') iv. Use SQL Authentication -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Nov 3, 10:27 am, "Magnus D." <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Marnen Laibow-Koser wrote in post #958814:> Magnus D. wrote in post #958686:> > Advice: do not use MS SQL Server with Rails. Do not do Rails > > development on Windows. Both of these will make your life harder. > > I''m starting to learn this. :)A bit OT, but seeing as you mentioned it, as a Windows user that has recently migrated my Rails apps to a Linux box, I can confirm what I have frequently read on this group: Rails and Linux > Rails and Windows. I was brand new to Linux, and got everything up and running in no time compared with my original struggles on Windows, and it looks like a far better OS. If you haven''t yet made the jump, I would recommend it. Best Paul (Linux convert) -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
pepe wrote in post #959313:> On Nov 2, 7:38am, "Magnus D." <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> I''m trying to connect to a SQLServer 2008 database running on localhost, >> but I can''t seem to get it working. > > Hi Magnus, > > I am using MSSQL and like you I had lots of trouble making it work but > I finally did get it to work. I am also using XP and here is my Ruby > and Rails environment: >Thanks. I''m now trying to reinstall ruby on my computer, and if that doesn''t work, I''m thinking about throwing it out the window. Magnus -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 November 2010 13:34, Magnus D. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> pepe wrote in post #959313: >> On Nov 2, 7:38am, "Magnus D." <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> I''m trying to connect to a SQLServer 2008 database running on localhost, >>> but I can''t seem to get it working. >> >> Hi Magnus, >> >> I am using MSSQL and like you I had lots of trouble making it work but >> I finally did get it to work. I am also using XP and here is my Ruby >> and Rails environment: >> > > Thanks. > > I''m now trying to reinstall ruby on my computer, and if that doesn''t > work, I''m thinking about throwing it out the window.You might be better to throw Windows out of your computer rather than the computer out of the window. Colin -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> I''m now trying to reinstall ruby on my computer, and if that doesn''t > work, I''m thinking about throwing it out the window. > > MagnusIn a few months I would like to be where Paul is at and pretty much every day of my life I feel like doing what Colin is suggesting. ;) pepe -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.