1

I'm trying to convert my rubyonrails project from sqlite3 to MySQL by following:

Here is the command line log:

plee@sos:~/rubyonrails/blog$ gem install yaml_db
Successfully installed yaml_db-0.2.3
1 gem installed
Installing ri documentation for yaml_db-0.2.3...
Installing RDoc documentation for yaml_db-0.2.3...

plee@sos:~/rubyonrails/blog$ gem list | grep yaml_db
yaml_db (0.2.3)

plee@sos:~/rubyonrails/blog$ rake db:data:dump
rake aborted!
Don't know how to build task 'db:data:dump'

(See full trace by running task with --trace)

plee@sos:~/rubyonrails/blog$ rake db:dump
rake aborted!
Don't know how to build task 'db:dump'

(See full trace by running task with --trace)
plee@sos:~/rubyonrails/blog$ 

and my OS info:

plee@sos:~/rubyonrails/blog$ uname -a
Linux sos 2.6.38-15-generic-pae #60-Ubuntu SMP Tue May 22 11:48:17 UTC 2012 i686 i686 i386 GNU/Linux
plee@sos:~/rubyonrails/blog$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 11.04
Release:    11.04
Codename:   natty
Community
  • 1
  • 1
Peter Lee
  • 12,931
  • 11
  • 73
  • 100

1 Answers1

8

I finally figured out why. The installation requires two steps:

Step 1. Install the gem yaml_db:

gem install yaml_db

Step 2. Add it to the Gemfile under your project home director

gem 'yaml_db'

Then we can run rake db:dump without any problems.

Peter Lee
  • 12,931
  • 11
  • 73
  • 100
  • This helps, but I'm still getting the following error... rake db:data:dump rake aborted! undefined method `+' for nil:NilClass (erb):80:in `
    ' /Users/user/.rvm/gems/ruby-1.9.3-p392/gems/mongoid-3.0.23/lib/mongoid/config/environment.rb:40:in `load_yaml'
    – ATSiem Jun 07 '13 at 14:12