This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 167017

Summary: Cannot create *_development db with db:create
Product: ruby Reporter: Jeffrey Rubinoff <jeff_rubinoff>
Component: RakeAssignee: Erno Mononen <emononen>
Status: RESOLVED WONTFIX    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: Windows Vista   
Issue Type: DEFECT Exception Reporter:

Description Jeffrey Rubinoff 2009-06-13 00:13:07 UTC
I've been testing the Ruby Weblog in 10 Minutes tutorial. When I reach the part where I use db:create to create
databases, I do not create a rubyweblog_development database in my MySQL server. I create the _test and _production
databases without problem. The database.yml entry for development: is identical, except for names, to the database.yml
entries for the test: and production: databases. To wit:

development:
  adapter: jdbcmysql
  encoding: utf8
  reconnect: false
  database: rubyweblog_development
  pool: 5
  username: root
  password:
  host: localhost

test:
  adapter: jdbcmysql
  encoding: utf8
  reconnect: false
  database: rubyweblog_test
  pool: 5
  username: root
  password:
  host: localhost

As a workaround, I can use NB database management to manually create a rubyweblog_development database and then migrate
it to the current version.
Comment 1 Jeffrey Rubinoff 2009-06-15 09:47:16 UTC
Some additional information:
The db:create:all function also does not create rubyweblog_development. It is the function I used to create
rubyweblog_test and rubyweblog_production.
I first tried this with no Rails environment set, but even with the "development" environment selected, the function did
not work.
Comment 2 Jeffrey Rubinoff 2009-06-15 10:02:58 UTC
I cannot create rubyweblog_test with db:create and the RAILS_ENV=test parameter, either.
I'm sorry that I originally said I created the test and production db's with db: create. I'm sure I did but it doesn't
seem to work now. Maybe I created them with db:create:all instead, or maybe there is a regression between RC2 and RC3. I
have the latest dev Ruby plugin now for RC2 so can't retry.
Comment 3 Erno Mononen 2009-07-03 11:55:18 UTC
I think AR-JDBC is at fault - can you try running rake db:create --trace from the command line (in the project 
directory)?
Comment 4 Erno Mononen 2009-08-25 09:06:01 UTC
Caused by this issue:

http://jira.codehaus.org/browse/JRUBY-3502 
Comment 5 hassanh 2009-09-09 21:23:47 UTC
it looks like the first entry in the database.yml is being skiped add an extra database definition as bellow
archive:
  adapter: jdbcmysql

  encoding: utf8
  reconnect: false
  database: archive
  pool: 5
  username: root
  password: 
  host: localhost

development:
  adapter: jdbcmysql

  encoding: utf8
  reconnect: false
  database: library_development
  pool: 5
  username: root
  password: 
  host: localhost
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: jdbcmysql
  encoding: utf8
  reconnect: false
  database: library_test
  pool: 5
  username: root
  password: 
  host: localhost

production:
  adapter: jdbcmysql
  encoding: utf8
  reconnect: false
  database: library_production
  pool: 5
  username: root
  password: 
  host: localhost
Comment 6 Erno Mononen 2010-03-16 09:17:45 UTC
Closing as wontfix, the bug is in AR-JDBC. I will update the bundled gems for 6.9 anyway, so 6.9 will ship with a newer version of AR-JDBC.