I just ran into the exact same problem yesterday. I have been playing
with RoR 1.x with a local version of MSSQL Server 2005 for a few
months now but after I upgraded to RoR 2.0 this week, I received the
same error message you did. This worked fine for me today. There have
been a few other issues I've been getting but at least this ones done.
It appears that browser connections are forbidden. The gem install
command works fine.
It didn't work for me:
C:\Ruby187>gem install activerecord-sqlserver-adapter
--source=http://gems.rubyonrails.org
ERROR: Could not find a valid gem 'activerecord-sqlserver-adapter' (>=
0) in any repository
Not that I'm a MS fan or anything but I'm new to Ruby and I would think
that finding an MS adapter should be relativity easy. Any help would be
greatly appreciated.
It didn't work for me:
C:\Ruby187>gem install activerecord-sqlserver-adapter
--source=http://gems.rubyonrails.org
ERROR: Could not find a valid gem 'activerecord-sqlserver-adapter' (>=
0) in any repository
Have you tried simply:
gem install activerecord-sqlserver-adapter
I am using MSSQL all the time and that is working for me.
It didn't work for me:
C:\Ruby187>gem install activerecord-sqlserver-adapter
--source=http://gems.rubyonrails.org
ERROR: Could not find a valid gem 'activerecord-sqlserver-adapter' (>=
0) in any repository
Have you tried simply:
gem install activerecord-sqlserver-adapter
I am using MSSQL all the time and that is working for me.
Thanks pepe. I had gone to RubyGems.org and it instructed me to do the
same thing you advised and it works!
Since you use MSSQL all the time perhaps you could answer my next
hurdle. How do I convert my connection into a dsn? My connection
string is:
jdbc:jtds:sqlserver://rogue:1433/AALite;
My ruby client is on windows so I think I need a dsn. Each time I try
to set up a dsn I get the error: SQLState 42000 SQL Server Error: 4064
Since you use MSSQL all the time perhaps you could answer my next
hurdle. How do I convert my connection into a dsn? My connection
string is:
jdbc:jtds:sqlserver://rogue:1433/AALite;
Hi there,
This is a list I use when setting up a new MSSQL based application.
You might need to skip/change some of the steps. I hope it helps:
1. Install Ruby (1.8.6): Download Ruby
2. Install rubygems:
a. Download RubyGems | RubyGems.org | your community gem host (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
9. Install SQL Server Management utility (from Microsoft)
10. Create SQL Server DB (name <your_name_here>)
11. Create login in SQL Server (<your_name_here> For simplicity I use
the same name as DB)
12. Create DB user (<your_name_here>)
13. 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: <your_name_here> For simplicity I use the same name as
the DB
ii. Description: <your_description_here>
iii. Server: Server name (<value_from_SQL_Server_Management>
Something like XXXXXXXXXX\SQLEXPRESS)
iv. Use SQL Authentication
Then in your database.yml something like this:
development:
adapter: sqlserver
mode: odbc
dsn: <your_dsn_name_here>
username: <your_db_user_here>
password: <your_db_password_here>
# host: not required when DSN is used
I read in a post a few days ago that if you use DSN you don't even
need username and password. I have not tried that so I can't say for
sure.