Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8145397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:39:02+00:00 2026-06-06T13:39:02+00:00

I am trying to set up Rails tests with MS SQL server. Currently Rails

  • 0

I am trying to set up Rails tests with MS SQL server. Currently Rails is working just fine with the normal development environment environment on the same SQL server instance.

I initially tried by manually creating a database with the same login as I used for development attached to it called PRODUCT_TEST. Database created fine.

when I ran rake db:test:prepare I got this

C:\Code\git.product>rake db:test:prepare
rake aborted!
ActiveRecord::JDBCError: CREATE DATABASE permission denied in database 'master'.: CREATE DATABASE PRODUCT_TEST

so it looks like it drops and recreates the DB.

I added the user to all of the roles of the DB server and tries again and got this.

C:\Code\git.product>rake db:test:prepare --trace
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
rake aborted!
The driver encountered an unknown error: Cannot open database "PRODUCT_TEST" requested by the login. The login failed.
C:/Program Files/jruby-1.7.0.preview1/lib/ruby/gems/shared/bundler/gems/activerecord-jdbc-adapter-e49ec53fb369/lib/arjdbc/jdbc/connection.rb:91:in `initialize'
C:/Program Files/jruby-1.7.0.preview1/lib/ruby/gems/shared/bundler/gems/activerecord-jdbc-adapter-e49ec53fb369/lib/arjdbc/jdbc/adapter.rb:33:in `initialize'

The database no longer exists and has been dropped. I tried this with both the user I created and the ‘sa’ user and neither work. I am able to connect to the database server and my development database using either just fine, both in enterprise manager and rails.

The database.yml looks like this

test:
  adapter: jdbcmssql
  username: sa
  password: password
  host: 127.0.0.1
  database: PRODUCT_TEST

Any idea what I am doing wrong?

Thanks.

Note: using Rails 3.2.3, JRuby 1.7.0.preview, Microsoft SQL Server Express Edition (64-bit) 10.50.1617.0

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:39:04+00:00Added an answer on June 6, 2026 at 1:39 pm

    Fixed: I recreated the PRODUCT_TEST database manually and and assigned the account as the owner. This time the tool did not drop the database and was able to access it correctly

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to set up a development environment for a legacy Rails 2.3.8 project.
I started trying to set up a local rails installation for development. After I
I'm currently trying to set up integration/acceptance testing for a new rails 3 application
I am just trying to use mysql with rails with a mongrel server. I
I was recently trying to set up an Amazon EC2 instance to run Rails
In Rails 3.2 I'm trying to set a default OdontologicUnity instace when a User
I'm trying to set up cucumber for rails. I included this in my Gemfile
I am trying to set up jQuery autocomplete in Rails 3.2.0. I have it
I'm trying to set up a date of birth helper in my Rails app
In my ruby(1.9.3) on rails (3.1) app I'm trying to set some conditional behavior

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.