Reputation: 1893
I'm helping out a friend modify a rails website he was given, I've only got a surface knowledge of rails and ruby but enough to do what he needs me to do. Trouble is I've run into this error setting up my development environment and I cannot nut it out.
Running:
$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
development database is not configured
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection'
/var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
/home/rory/projects/project_server/ruby_lib/project/lib/project/model.rb:21:in `init'
/home/rory/projects/project_server/ruby_lib/project/lib/project/model.rb:15:in `each'
/home/rory/projects/project_server/ruby_lib/project/lib/project/model.rb:15:in `init'
/home/rory/projects/project_server/ruby_lib/project/lib/project/project.rb:218:in `init' /home/rory/projects/project_server/rails/project_web/config/environments/development.rb:28:in `load_environment'
/var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:386:in `load_environment'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:379:in `load_environment'
/var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:137:in `process'
/var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:113:in `send'
/var/lib/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:113:in `run'
/home/rory/projects/project_server/rails/project_web/config/environment.rb:9
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in `gem_original_require'
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
/var/lib/gems/1.8/gems/rails-2.3.14/lib/tasks/misc.rake:4
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/var/lib/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19
Running
$ rake db:create
works as expected, creating the database in mysql.
I have checked the database.yml is correctly indented with spaces not tabs. All the required libraries are installed.
The site runs (and therefore I am running in my development environment):
ruby 1.8.7 rails 2.3.14
database.yml:
development:
adapter: mysql
database: development
username: developer
password: devpass
socket: /var/run/mysqld/mysqld.sock
Upvotes: 0
Views: 3238
Reputation: 5095
+1 on what Edd Morgan said in a comment.
Also, please paste your database.yml. For me it looks like the problem is trivial. The rake task is expecting that you have development db defined and it looks like you don't have it defined. So it raises "development database is not configured".
Most prolly you're missing a definition like:
development:
adapter: mysql
encoding: utf8
host: 'you_host'
username: 'username'
password: 'password'
Upvotes: 2