Topic: Rake db:migrate issue

I have a new app that I am unable to run any of the rake tasks. I ran bundle install to begin with and I checked that the rails and ruby versions are up to date. When I run rake db:migrate I receive the following:

Lalos-Macbook-Air:Visitorr lalo$ rails -v
Rails 3.1.3
Lalos-Macbook-Air:Visitorr lalo$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
Lalos-Macbook-Air:Visitorr lalo$ bundle install
Using rake (0.9.2.2)
Using multi_json (1.0.4)
Using activesupport (3.1.3)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.3)
Using erubis (2.7.0)
Using rack (1.3.5)
Using rack-cache (1.1)
Using rack-mount (0.8.3)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.0.3)
Using actionpack (3.1.3)
Using mime-types (1.17.2)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.3.0)
Using actionmailer (3.1.3)
Using arel (2.2.1)
Using tzinfo (0.3.31)
Using activerecord (3.1.3)
Using activeresource (3.1.3)
Using addressable (2.2.6)
Using bcrypt-ruby (3.0.1)
Using orm_adapter (0.0.5)
Using ckeditor (3.6.3)
Using coffee-script-source (1.1.3)
Using execjs (1.2.9)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.6.2)
Using rdoc (3.11)
Using thor (0.14.6)
Using railties (3.1.3)
Using coffee-rails (3.1.1)
Using daemons (1.1.4)
Using delayed_job (2.1.4)
Using eventmachine (0.12.10)
Using multipart-post (1.1.4)
Using faraday (0.6.1)
Using haml (3.1.4)
Using has_unique_slug (0.1.4)
Using launchy (2.0.5)
Using rest-client (1.6.7)
Using rubyzip (0.9.5)
Using term-ansicolor (1.0.7)
Using heroku (2.14.0)
Using jquery-rails (1.0.19)
Using libv8 (3.3.10.4)
Using oauth (0.4.5)
Using oauth2 (0.4.1)
Using paypal-recurring (0.1.7) from git://github.com/jhliberty/paypal-recurring.git (at master)
Using pg (0.11.0)
Using bundler (1.1.1)
Using rails (3.1.3)
Using sass (3.1.11)
Using sass-rails (3.1.5)
Using sorcery (0.7.5)
Using sqlite3 (1.3.4)
Using stripe (1.5.24)
Using therubyracer (0.9.9)
Using thin (1.3.1)
Using uglifier (1.1.0)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Lalos-Macbook-Air:Visitorr lalo$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
syntax error on line 17, col 0: `======='
/Users/lalo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/syck.rb:135:in `load'
/Users/lalo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/syck.rb:135:in `load'
/Users/lalo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/syck.rb:146:in `block in load_file'
/Users/lalo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/syck.rb:145:in `open'
/Users/lalo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/syck.rb:145:in `load_file'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/sprockets/railtie.rb:40:in `block in <class:Railtie>'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializers'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/lalo/Documents/Aptana Studio 3 Workspace/Visitorr/config/environment.rb:5:in `<top (required)>'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application.rb:83:in `require_environment!'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application.rb:193:in `block (2 levels) in initialize_tasks'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/lalo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/lalo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/lalo/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'

Below is my database.yml:


# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

# 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: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000

Last edited by eddielopezzz (2012-03-19 20:01:24)

Re: Rake db:migrate issue

What's contained here:

/Users/lalo/Documents/Aptana Studio 3 Workspace/Visitorr/config/environment.rb:5

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Rake db:migrate issue

Thanks for you reply. Below is what I see in the file you requested:

Lalos-Macbook-Air:config lalo$ cat environment.rb
# Load the rails application
require File.expand_path('../application', __FILE__)

# Initialize the rails application
Visitorr::Application.initialize!

Re: Rake db:migrate issue

Hmmm.... 

What's in the config/initializers directory?

Also,  try

bundle update

then run the migration again.

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Rake db:migrate issue

Ok I tried bundle update

Lalos-Macbook-Air:Visitorr lalo$ bundle update
Updating git://github.com/jhliberty/paypal-recurring.git
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
Using rake (0.9.2.2)
Installing multi_json (1.1.0)
Using activesupport (3.1.3)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.3)
Using erubis (2.7.0)
Installing rack (1.3.6)
Installing rack-cache (1.2)
Using rack-mount (0.8.3)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.0.3)
Using actionpack (3.1.3)
Using mime-types (1.17.2)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Installing mail (2.3.3)
Using actionmailer (3.1.3)
Installing arel (2.2.3)
Installing tzinfo (0.3.32)
Using activerecord (3.1.3)
Using activeresource (3.1.3)
Installing addressable (2.2.7)
Using bcrypt-ruby (3.0.1)
Using bundler (1.1.1)
Installing orm_adapter (0.0.6)
Using ckeditor (3.6.3)
Installing coffee-script-source (1.2.0)
Installing execjs (1.3.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Installing json (1.6.5) with native extensions
Installing rdoc (3.12)
Using thor (0.14.6)
Using railties (3.1.3)
Using coffee-rails (3.1.1)
Installing daemons (1.1.8)
Installing delayed_job (3.0.1)
Using eventmachine (0.12.10)
Installing multipart-post (1.1.5)
Installing faraday (0.7.6)
Using haml (3.1.4)
Installing has_unique_slug (0.1.6)
Installing launchy (2.1.0)
Installing netrc (0.7.1)
Using rest-client (1.6.7)
Installing rubyzip (0.9.6.1)
Installing heroku (2.21.3)
Using jquery-rails (1.0.19)
Using libv8 (3.3.10.4)
Using oauth (0.4.5)
Installing oauth2 (0.5.2)
Using paypal-recurring (0.1.8) from git://github.com/jhliberty/paypal-recurring.git (at master)
Installing pg (0.13.2) with native extensions
Using rails (3.1.3)
Installing sass (3.1.15)
Installing sass-rails (3.1.6)
Installing sorcery (0.7.7)
Using sqlite3 (1.3.5)
Installing stripe (1.6.2)
Installing therubyracer (0.9.10) with native extensions
Using thin (1.3.1)
Installing uglifier (1.2.3)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.

I tried to run rake db:migrate again and I noticed a different error:

Lalos-Macbook-Air:Visitorr lalo$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
couldn't parse YAML at line 18 column 0

Looking at the database.yml file (line 18 is 'pool: 5 ' under test configuration):


# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

# 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: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000

I have heard that the database.yml file needs to be formatted correctly. Is there a specific way to make sure or am I looking at it wrong? 

Thanks once again for looking into this.

Re: Rake db:migrate issue

maybe sqlite3 doesn't respond to the 'pool' attribute,  try deleting it from database.yml

Sorry,  but I always deploy with 'mysql'  so I'm not familiar with sqlite3!

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Rake db:migrate issue

I don't think that is the issue because this is the default yaml file that comes when I created the rails application the first time. I will certainly try it but I have other apps that have the exact same yaml file and they work properly. Infact I copied over the yaml file from a working app to this one in hopes that it would work but still am not able to run any migrations.

Re: Rake db:migrate issue

Hi Mr. Hodges,

I want to thank you for looking into this. I found out what the issue is. I loaded 'irb' and loaded each yml file I could find and I found which yaml file was the one causing the issue

unknown68a86d056088:Visitorr lalo$ find . -name \*.yml -print
./config/database.yml
./config/locales/en.yml
./public/assets/manifest.yml
unknown68a86d056088:Visitorr lalo$

1.9.2-p290 :008 > YAML.load_file('public/assets/manifest.yml')
Psych::SyntaxError: couldn't parse YAML at line 18 column 0
        from /Users/lalo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse'
        from /Users/lalo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse_stream'
        from /Users/lalo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:119:in `parse'
        from /Users/lalo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:106:in `load'
        from /Users/lalo/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:205:in `load_file'
        from (irb):8
        from /Users/lalo/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
1.9.2-p290 :009 >

I opened that manifest.yaml file and saw that line 18 has weird characters.

/Users/lalo/Documents/Aptana Studio 3 Workspace/Visitorr/public/assets
unknown68a86d056088:assets lalo$ cat manifest.yml
---
american_express.png: american_express-db5bb4b28f66ad56b2ad42306a8606e8.png
assimilation.png: assimilation-c0701a8c5ceb9fc787c83e56f111662c.png
connect.png: connect-bfdbe5470afb1e90f6eb74bb4dc00082.png
*.png: *-cf4f2d54f4f178b3ae98d872a6ac8fa0.png
discover.png: discover-948aac28b34a176b7905a195defbf805.png
getstarted.png: getstarted-86b02149122d93b576c605a7da5299b4.png
gmail.png: gmail-2549b0b07fd0782b02b0e595a5120741.png
growth.png: growth-5572faa83f77e75fba226fb12a26caac.png
header_bg.jpg: header_bg-5902294069e6f3b5e0879958ca4facc4.jpg
iphone4.png: iphone4-7719ce363a8dd818b405dff9bc4412f6.png
jcb.png: jcb-c22e048e7ae3bf61ae7b0a703ea81be3.png
logo.png: logo-d1570d236f6fee353d533db153811167.png
logo1.png: logo1-d1570d236f6fee353d533db153811167.png
mastercard.png: mastercard-1c3c61a566f720aaec831c321cc17076.png
paypal.png: paypal-ead976d8b1dae23c8f289a61070dce65.png
<<<<<<< HEAD
=======
pricing.gif: pricing-c71e495b95f255a00dbb8ccdc2e1e5d2.gif
>>>>>>> 7a4ccab5396bf9fe976c1459f694de75029476f5
pricing.png: pricing-d98b267cafa187d1f2e8d6e464134c6f.png
rails.png: rails-e4b51606cd77fda2615e7439907bfc92.png
signup-blk.png: signup-blk-1144e125e3399c6370e7377971435705.png
signup-red.png: signup-red-d7b41e61c555c3369efa8ab6249d4fd2.png
stockphoto.jpg: stockphoto-9b6d365aff7bc5ffc0de2dbcc08477f1.jpg
visa.png: visa-39937bd05ae24577f0ad54814e6274d9.png
visitorr_logo.png: visitorr_logo-99879af0d4cb42e35c819ec5a8a9be40.png
application.js: application-dc1da251b47117f734c3ab94e92a85e6.js
application.css: application-e906154436089cc1817087d4633c9ef8.css
unknown68a86d056088:assets lalo$

I'm getting closer and hopefully I should figure it out now that I am almost there.

Last edited by eddielopezzz (2012-03-22 22:28:18)