Rake aborted! Incorrect database name? - ruby-on-rails

I was hoping to run some unit tests but this is what I am getting. The internets are silent on the issue. Rails 2.1
Let me know if there is any other info that would help.
mike#sleepycat:~/projects/myapp$ rake test:units --trace
(in /home/mike/projects/myapp)
** Invoke test:units (first_time)
** Invoke db:test:prepare (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:clone (first_time)
** Invoke db:schema:dump (first_time)
** Invoke environment
** Execute db:schema:dump
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
rake aborted!
Mysql::Error: Incorrect database name '': DROP DATABASE IF EXISTS ``
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:147:in `log'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/mysql_adapter.rb:299:in `execute'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/mysql_adapter.rb:384:in `drop_database'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/mysql_adapter.rb:364:in `recreate_database'
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/tasks/databases.rake:315
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
My database.yml:
# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql
# On MacOS X:
# gem install mysql -- --include=/usr/local/lib
# On Windows:
# gem install mysql
# Choose the win32 build.
# Install MySQL and put its /bin directory on your path.
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql
database: myapp_development
username: root
password: mikespass
host: 127.0.0.1
#socket: /tmp/mysql.sock
# 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: mysql
database: myapp_test
username: root
password: mikespass
host: 127.0.0.1
production:
adapter: mysql
database: myapp_production
username: root
password:
mikes:
adapter: mysql
database: myapp_development
username: root
password: mikespass
host: 127.0.0.1
staging:
adapter: mysql
database: myapp_development
username: root
password: mikespass
host: 127.0.0.1

It looks like you haven't specified a database name for the test environment in your config/database.yml file.

cant end lines in comments so i'll just put it here
can you run script/console then do :
#a = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
#a
then paste the contents of #a

Related

Rake Not Creating Tables

Problem
rake db:migrate is not creating tables in my MySQL database. (Yes, I have read all similar posts, and implemented their suggestions, please continue reading.)
Code
database.yml:
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: root
password:
host: localhost
port: /tmp/mysql.sock
development:
<<: *default
database: asreport
Line from gemfile (yes, I already gem install'd it too):
gem 'mysql2', '~> 0.3.20'
/appfile/db/migrate/create_users.rb (I've also tried making the second line 'def up'):
class CreateUsers < ActiveRecord::Migration
def up
create_table :users do |t|
t.string :username
t.string :password
t.integer :usertype
t.string :salt
t.timestamps
end
end
end
After I run rake db:drop, rake db:create to refresh, rake db:migrate --trace reads (after this output, 'show tables' in mysql still only shows schema_migrations):
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump
What I've Tried
First of all, I know that I am connecting to MySQL via Ruby, as db:drop create does indeed create the database itself, just not the table.
I've read all the relevant stack overflow posts I could find on the issue. I've tried rollback, dropping my database directly on SQL, and db:drop/create.
I've tried deleting and recreating my migration script too.
I've run db:migrate multiple times (by itself and after db:drop/create's, rollback's, resets), but the schema_migrations always has 0 entries and my schema.rb file is on version: 0.
You're not following the naming conventions outlined in the Rails Guides.
Specifically, this:
2.1
Creating a Standalone Migration Migrations are stored as files in the db/migrate directory, one for each migration class. The name of
the file is of the form YYYYMMDDHHMMSS_create_products.rb, that is to
say a UTC timestamp identifying the migration followed by an
underscore followed by the name of the migration. The name of the
migration class (CamelCased version) should match the latter part of
the file name. For example 20080906120000_create_products.rb should
define class CreateProducts and
20080906120001_add_details_to_products.rb should define
AddDetailsToProducts. Rails uses this timestamp to determine which
migration should be run and in what order, so if you're copying a
migration from another application or generate a file yourself, be
aware of its position in the order.
Go ahead and try a dummy migration to see the file name convention.
$ bin/rails generate migration AddPartNumberToProducts part_number:string

db:migrate:reset doesn't work with environment variables

The way I set up environment variables is like it was outlined here.
In other words I created a config/app_env_vars.rb file and put:
unless Rails.env.production?
ENV['DB_PASSWORD'] = 'password'
ENV['DB_USERNAME'] = 'username'
end
puts 'ECHO app_env_vars.rb'
In config/environment.rb I put:
app_env_vars = File.join(Rails.root, 'config', 'app_env_vars.rb')
load(app_env_vars) if File.exists?(app_env_vars)
puts "ECHO environment.rb"
right before Rails.application.initialize!
In database.yml:
development:
adapter: postgresql
encoding: unicode
database: my_app_development
host: localhost
pool: 5
password: <%= ENV['DB_PASSWORD'] %>
test:
adapter: postgresql
encoding: unicode
database: my_app_test
host: localhost
pool: 5
password: <%= ENV['DB_PASSWORD'] %>
When I run tasks such as bundle exec rake db:migrate and bundle exec rake db:reset it works fine but when I run bundle exec rake db:migrate:reset it will fail displaying:
fe_sendauth: no password supplied
.
.
.
Couldn't drop my_app_development
fe_sendauth: no password supplied
.
.
.
Couldn't drop my_app_test
fe_sendauth: no password supplied
ECHO app_env_vars.rb
ECHO environment.rb
Usually when I run bundle exec rake db:migrate (and db:drop) it will first display the ECHO parts and then do the task and out put the log. But in the case of the db:migrate:reset it won't initialize the environment variables until after the task.
When in database.yml I put the actual passwords rather than the env variables then the
db:migrate:reset works with no problem.
Here is rake db:migrate:reset with --trace option
** Invoke db:migrate:reset (first_time)
** Invoke db:drop (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:drop
fe_sendauth: no password supplied
.
. # gem trace stuff...
.
Couldn't drop my_app_development
fe_sendauth: no password supplied
.
. # gem trace stuff...
.
Couldn't drop my_app_test
** Invoke db:create (first_time)
** Invoke db:load_config
** Execute db:create
fe_sendauth: no password supplied
.
. # gem trace stuff...
.
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"my_app_development", "host"=>"localhost", "pool"=>5, "password"=>nil}
fe_sendauth: no password supplied
.
. # gem trace stuff...
.
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"my_app_test", "host"=>"localhost", "pool"=>5, "password"=>nil}
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
ECHO app_env_vars.rb
ECHO environment.rb
** Invoke db:load_config
** Execute db:migrate
** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump
** Execute db:migrate:reset
Here is the --trace for rake db:reset
** Invoke db:reset (first_time)
** Invoke environment (first_time)
** Execute environment
ECHO app_env_vars.rb
ECHO environment.rb
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:reset
** Invoke db:drop (first_time)
** Invoke db:load_config
** Execute db:drop
** Invoke db:setup (first_time)
** Invoke db:schema:load_if_ruby (first_time)
** Invoke db:create (first_time)
** Invoke db:load_config
** Execute db:create
** Invoke environment
** Execute db:schema:load_if_ruby
** Invoke db:schema:load (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:load
-- enable_extension("plpgsql")
-> 0.0772s
-- create_table("users", {:force=>true})
-> 0.0795s
-- add_index("users", ["email"], {:name=>"index_users_on_email", :unique=>true, :using=>:btree})
-> 0.0406s
-- initialize_schema_migrations_table()
-> 0.0829s
** Invoke db:structure:load_if_sql (first_time)
** Invoke db:create
** Invoke environment
** Execute db:structure:load_if_sql
** Invoke db:seed (first_time)
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment
** Execute db:abort_if_pending_migrations
** Execute db:setup
In the case of db:reset the ** Execute environment part is done before any executions, while with db:migrate:reset the ** Execute environment is done after a few executions
The reason why this setup (setting env variables in a file then load them trough environment.rb) doesn't work is because active record can be used outside rails therefore now every task runs with initialized rails environment.
A better solution is to use gems like figaro or dot-env which will load with every rake task. How exactly is that done with those gems I am not sure but if I get into it and find out I'll post here.

rake db:create gives undefined method `[]' for nil:NilClass error

Postgres 9.3, Ruby 2.1.0
rake db:create isn't making a test database. I already have a production database. I tried using RAILS_ENV=test rake db:create to force it but it returns "test database is not configured.
My database.yml ->
development:
adapter: postgresql
  database: app_prod
  host: localhost
test: &test
  adapter: postgresql
  database: app_test
  host: localhost
cucumber:
<<: *test
production:
  adapter: postgresql
 database: app_prod
  host: localhost
So it is configured. I also tried just using a console createdb app_test to create my test database but I receive the same error when I try to run rake db:test:prepare.
Anyone have any ideas?
this is --trace on db:create:all
** Invoke db:create:all (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:create:all
rake aborted!
undefined method `[]' for nil:NilClass
/Users/username/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-4.0.3/lib/active_record/tasks/database_tasks.rb:189:in `block in each_local_configuration'
this is trace on db:test:prepare
** Invoke db:test:prepare (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config
** Execute db:test:purge
rake aborted!
undefined method `[]' for nil:NilClass
/Users/username/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-4.0.3/lib/active_record/tasks/database_tasks.rb:137:in `purge'
Try running this in console
ActiveRecord::Base.configurations
You should get your database configurations.
Line 3 in this method(Line 189 in github) is failing in your case because configuration is nil
def each_local_configuration
ActiveRecord::Base.configurations.each_value do |configuration|
next unless configuration['database']
if local_database?(configuration)
yield configuration
else
$stderr.puts "This task only modifies local databases. #{configuration['database']} is on a remote host."
end
end
end

rake aborted error while implementing db:drop in rails 3.2

I am new to rails.I was trying rake db:drop but am getting the following error
rake aborted!
(<unknown>): mapping values are not allowed in this context at line 21 column 12
/home/chiron/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.11/lib/rails/application/configuration.rb:115:in `database_configuration'
/home/chiron/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.11/lib/active_record/railties/databases.rake:25:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:drop => db:load_config
(See full trace by running task with --trace)
I am installing on ubuntu.While working the same code for windows environment it seems to work perfectly
My database.yml is as follows:-
# PostgreSQL v0.8.x
# gem install pg
development:
adapter: postgresql
encoding: unicode
host: localhost
database: lib_development
pool: 5
username: chiron
password:
# 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: postgresql
encoding: unicode
host: localhost
database: lib_test
pool: 5
username: chiron
password:
production:
adapter: postgresql
encoding: unicode
host: localhost
database: lib_production
pool: 5
username: chiron
password:
Can anyone please help me
you have redundant spacebar in config
pool: 5
username: chiron # << here
password:

rake db:migrate and rake db:create both work on test database, not development database

I am new to Stack Overflow and Ruby on Rails. My problem is, when I run the command rake db:create or rake db:migrate, the test database is affected, but the development database is not.
rails (3.2.2)
my database.yml:
# 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: &test
adapter: postgresql
encoding: unicode
database: ticketee_test
pool: 5
username: ticketee
password: my_password_here
development:
adapter: postgresql
encoding: unicode
database: ticketee_development
pool: 5
username: ticketee
password: my_password_here
production:
adapter: postgresql
encoding: unicode
database: ticketee_production
pool: 5
username: ticketee
password: my_password_here
cucumber:
<<: *test
Thanks for the suggestion, but I am afraid that isn't the reason. My RAILS_ENV=development. When I start the rails server, the server runs the development database. if I run "rails server -e test" then the server uses the test database. I am still not sure why migrations are running on my test database...
UPDATE:
Based on a suggestion, I commented out all of the database configurations except development, and now I get an error. I am running postgresql, I have the gem 'pg' installed. First, my new database.yml:
development:
adapter: postgresql
encoding: unicode
database: ticketee_development
pool: 5
username: ticketee
password: my_password_here
# 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: &test
# adapter: postgresql
# encoding: unicode
# database: ticketee_test
# pool: 5
# username: ticketee
# password: my_password_here
#production:
# adapter: postgresql
# encoding: unicode
# database: ticketee_production
# pool: 5
# username: ticketee
# password: my_password_here
#cucumber:
# <<: *test
My error message!
Someguys-MacBook-Air:ticketee someguy$ rake db:migrate
rake aborted!
database configuration does not specify adapter
Tasks: TOP => db:migrate => db:load_config
(See full trace by running task with --trace)
Someguys-MacBook-Air:ticketee someguy$ rake db:migrate -t
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
rake aborted!
database configuration does not specify adapter
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:45:in `resolve_hash_connection'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:39:in `resolve_string_connection'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:23:in `spec'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:127:in `establish_connection'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/activerecord-3.2.2/lib/active_record/railtie.rb:76:in `block (2 levels) in <class:Railtie>'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/activesupport-3.2.2/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/activesupport-3.2.2/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/activesupport-3.2.2/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/activesupport-3.2.2/lib/active_support/lazy_load_hooks.rb:42:in `each'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/activesupport-3.2.2/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/activerecord-3.2.2/lib/active_record/base.rb:718:in `<top (required)>'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/activerecord-3.2.2/lib/active_record/railties/databases.rake:6:in `block (2 levels) in <top (required)>'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/someguy/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/someguy/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/bin/rake:19:in `load'
/Users/someguy/.rvm/gems/ruby-1.9.3-p125#defaultGems/bin/rake:19:in `<main>'
Using the database.yml above, rake db:create:all RAN CORRECTLY and created my table. However, my migration still fails with the same stack trace as the one above.
I changed my database.yml to this:
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
UPDATE: I completely changed my database.yml to this:
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
test: &test
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
cucumber:
<<: *test
Now, this is what happens when I run rake db:drop:all, followed by rake db:migrate. The rake db:migrate command runs a migration, creating a db/test.sqlite3 AND adding a table to it. So, my migration is still running on the test environment. When I run rake environment RAILS_ENV=development db:migrate, the same thing happens and I get a test.sqlite3 file...
There is a 'brilliant' line in
activerecord/lib/active_record/tasks/database_tasks.rb:
environments << 'test' if environment == 'development' && ENV['RAILS_ENV'].nil?
which, until jan 8, 2014 looked like:
environments << 'test' if environment == 'development'
I had the exact same problem starting last night. No idea what might have caused this, but finally found a solution that worked. Inside the configure block in config/environments/develop.rb, I added:
Rails.env = 'development'
I hope that works for you too
It sounds like your solution could be involving a couple of things. It's possible your your environment is confusing the migration because of existing elements. Reset your database using:
rake db:reset
or
rake db:drop db:create
depending on your environment, you should be able to do the migration.
rake db:migrate
PS - You may have to add bundle exec in the beginning of each command.
Good luck.
You are missing the host: localhost in your yml file.
Change your configuration to this:
development:
adapter: postgresql
encoding: unicode
host: localhost
database: ticketee_development
pool: 5
username: ticketee
password: my_password_here
Forking error!
Maybe some caching or log problems It shows that nothing of the errors in our code.
My team resolve it.
delete the project
git clone the project
config the database.yml
start server
Everything is okay!
The same project the errors gone!
So we think it is env problems or cach or log.
You can use rake db:migrate RAILS_ENV="development"
or you can use like
set RAILS_ENV=development
rake db:migrate

Resources