views:

27

answers:

1

Not exactly sure how to go about this.

My app's database.yml

development:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: application-dev
  pool: 5
  username: root
  password: angles123
  socket: /tmp/mysql.sock

I was thinking that it would be wise to go ahead and mysqladmin -u root --password=angles123, and then once inside create database application-dev, but the -dev part, mysql is not happy about. But Icould create a database that said simply application.

Am I missing someting else possibly?

The reason I am bringing this up is because I get this error whenever I try to rake db:migrate, or script/server

rake db:test:prepare
(in /Users/macuser/Sites/hq_channel)
rake aborted!
uninitialized constant Geocode

So I assumed I set up the database wrong because I clearly have that gem installed.

Here is the full stacktrace :

rake aborted!
uninitialized constant Geocode
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/dependencies.rb:443:in `load_missing_constant'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing_not_from_s3_library'
/Users/macuser/Sites/hq_channel/vendor/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/dependencies.rb:92:in `const_missing'
/Users/macuser/Sites/hq_channel/config/initializers/geocode.rb:1
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/dependencies.rb:145:in `load_without_new_constant_marking'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/dependencies.rb:145:in `load'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/dependencies.rb:145:in `load'
/Users/macuser/Sites/hq_channel/config/../vendor/rails/railties/lib/initializer.rb:622:in `load_application_initializers'
/Users/macuser/Sites/hq_channel/config/../vendor/rails/railties/lib/initializer.rb:621:in `each'
/Users/macuser/Sites/hq_channel/config/../vendor/rails/railties/lib/initializer.rb:621:in `load_application_initializers'
/Users/macuser/Sites/hq_channel/config/../vendor/rails/railties/lib/initializer.rb:176:in `process'
/Users/macuser/Sites/hq_channel/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
/Users/macuser/Sites/hq_channel/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
/Users/macuser/Sites/hq_channel/config/environment.rb:21
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/Users/macuser/Sites/hq_channel/vendor/rails/railties/lib/tasks/misc.rake:4
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
A: 

I've had mysql installations that didn't allow underscores or dashes in the database names.

You could try changing the database name to application and then running rake db:create to see if it creates your database.

Also, you can try running rake with --trace to get a better idea of what's being included from where that's causing that error.

wesgarrison
Hey I think you're right. I got this when I tried `rake db:create(in /Users/macuser/Sites/application)Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8", "username"=>"rootsies", "adapter"=>"mysql", "database"=>"application", "pool"=>5, "password"=>"angles1234", "socket"=>"/tmp/mysql.sock"}, charset: utf8, collation: utf8_general_ci (if you set the charset manually, make sure you have a matching collation)`
Trip
I have also, set priveleges for root and my user for the database as well. What do you think I missing?
Trip
Sounds like a database connection or permissions issue. Maybe you don't have CREATE permissions for your non-root user?
wesgarrison
Got the rake db:create to work by simply updating my LoadModules in apache. It seems those needed to be upgraded for a 64 bit computer to be able to process it. And I did the arch flags for mysql. When I run rake db:create it says it already exists now. So that works. But I still get the original geocode error if I do `rake db:migrate` or `rake db:test:prepare` or `script/server`
Trip
*blink* Updating Apache fixed mysql? Woah. Try removing that initializer (/config/initializers/geocode.rb) since running rake loads up your app, including environment and initializers.
wesgarrison
Clever! Well that definately got me through a majority of the migrations but it looks like its actually used somewhere with a `acts_as_geocodable` method in a few spots. So I'm going to put it back. :D
Trip
Sounds like you're back to getting Geocode/Geokit working as the root fix.
wesgarrison