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
4

1 回答 1

8

我终于明白为什么了。安装需要两个步骤:

步骤 1. 安装gem yaml_db

gem install yaml_db

步骤 2. 将其添加到Gemfile您的项目主目录下

gem 'yaml_db'

然后我们就可以rake db:dump毫无问题地运行了。

于 2012-06-19T20:02:41.823 回答