Hello i have been atempting to move a project from sqlite database to
a sql server database with absolutly no success. i am now going to
document my entire process so that mabey someone can se the error of
my ways. And if some one else has this problem this migth act as a
troubleshooting guide.
OS: windows server 2003 latest sp
Sql: Sql server 2008
Install ruby 192.p0 from http://rubyinstaller.com/downloads (ticked
both boxes ie add to PATH and associate files)
installation folder is c:/ruby192
2.Install rails via
“gem install rails”
Install mongrel via
“gem install mongrel --pre”
install the sql adapter via
“gem install activerecord-swlserver-adapter”
install dbd-odbc via
“gem install dbd-odbc”
this also installed the dbi gem so i wont install this from a separate
command
Ok now everything i need to start RoR with mongrel and Sql Server
should be installed as far as i know on to the gem file
Notes about this conf
dsn is the same name as the dsn i created with the odbc data source
administrator tool this is a system DSN by the way i have also tried
with file DSN
Ok now on to running my app
i go to the directory wich is located as follows
D:/projects/railsdev/projectname/
so i go there and execute
bundle install the result of this is
Error require: no such file to load --activerecord-sqlserver-adapter
if i change my require to a gem command everything is installed and
the server starts when i try to connect to the database i get another
error LoadError (no such file to load --odbc)
i have been loosing sleep over this please tell me what am i doing
wrong ?
“I must not fear. Fear is the mind-killer. I will face my fear. I will
permit it to pass over me and through me. And when it has gone past I
will
turn the inner eye to see its path. Where the fear has gone there will
be
nothing. Only I will remain.” - Bene Geserit’s Fear Lethany - Dune
Trilogy -
Frank Herbert
It’s not my tutorial. Just I found it some days ago
On Tue, Oct 26, 2010 at 9:41 AM, Fredrik TiC Jansson < [email protected]> wrote:
document my entire process so that mabey someone can se the error of
2.Install rails via
this also installed the dbi gem so i wont install this from a separate
"I must not fear. Fear is the mind-killer. I will face my fear. I will
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
“I must not fear. Fear is the mind-killer. I will face my fear. I will
permit it to pass over me and through me. And when it has gone past I
will
turn the inner eye to see its path. Where the fear has gone there will
be
nothing. Only I will remain.” - Bene Geserit’s Fear Lethany - Dune
Trilogy -
Frank Herbert
I finally got it working after a lot of googeling around big thanks
to
for pointing me towards ruby-odbc which was the final peice to solve
my puzzle
How to get Ruby on Rails working with MS SQLServer2008 and windows
server 2003
This mini tutorial assumes MS SQLServer2008 is installed and running i
will be using mongrel to deploy
install rails-dbi
gem install rails-dbi
NOTE: the reason for installing rails dbi and putting gem ‘rails-
dbi’, :require => ‘dbi’ in the gem file
is a conflict with the dbi and the deprecated gems. This issue migth
be resolved in the future.
Now its time to get on with editing our gemfile
put this in it
gem ‘rails-dbi’, :require => ‘dbi’
gem ‘ruby-odbc’
gem ‘activerecord-sqlserver-adapter’
gem ‘mongrel’, ‘1.2.0.pre2’ #this line will probably change in the
future this is written 2010-10-27
Then you need a connection string this will be in your config/
database.yml file
localhost migth suffice or if you have mutilple named instances like
me you have to include that as well
About dsn:
the dsn is created via the Data Sources(ODBC) tool under
administrative tools
Create a System DSN with the same name as dsn: dsn_name under client
configuration use TCP/IP(this should be default just adding this so
you know that this is correct)
now try to create a new project and a scaffold do a bundle install and
rake db:migrate if all went well you should be able to start your
server via rails server and start doing som CRUD against your
SQLServer2008 database
I finally got it working after a lot of googeling around big thanks
to
for pointing me towards ruby-odbc which was the final peice to solve
my puzzle
How to get Ruby on Rails working with MS SQLServer2008 and windows
server 2003
This mini tutorial assumes MS SQLServer2008 is installed and running i
will be using mongrel to deploy
install rails-dbi
gem install rails-dbi
NOTE: the reason for installing rails dbi and putting gem ‘rails-
dbi’, :require => ‘dbi’ in the gem file
is a conflict with the dbi and the deprecated gems. This issue migth
be resolved in the future.
Now its time to get on with editing our gemfile
put this in it
gem ‘rails-dbi’, :require => ‘dbi’
gem ‘ruby-odbc’
gem ‘activerecord-sqlserver-adapter’
gem ‘mongrel’, ‘1.2.0.pre2’ #this line will probably change in the
future this is written 2010-10-27
Then you need a connection string this will be in your config/
database.yml file
localhost migth suffice or if you have mutilple named instances like
me you have to include that as well
About dsn:
the dsn is created via the Data Sources(ODBC) tool under
administrative tools
Create a System DSN with the same name as dsn: dsn_name under client
configuration use TCP/IP(this should be default just adding this so
you know that this is correct)
now try to create a new project and a scaffold do a bundle install and
rake db:migrate if all went well you should be able to start your
server via rails server and start doing som CRUD against your
SQLServer2008 database
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.