简体   繁体   中英

rake db:schema:dump

$ rake db:schema:dump

rake aborted ! it says.. couldn't parse YAML at line 31 column 11 then gives a link to environment file in config folder

environment.rb:5 in <'top (required)'>

tasks: TOP => db:schema:dump =>environment

what i did was changed the database.yml's adapter from sqlite3 to mysql. installed the yaml_db gem, added the socket value to /tmp/mysql.sock (not sure what this is.. just copied from somewhere..nothing of this sort exists in my pc)

the environment.rb has

"#Load the rails application

require File.expand_path('../application', FILE )

"# Initialize the rails application

Cmsapp::Application.initialize!

the databse.yml

development: adapter: mysql encoding: utf8 reconnect: false database: simple_cms_development pool: 5 username: simple_cms password: vishesh socket: /tmp/mysql.sock

test: adapter: mysql encoding: utf8 reconnect: false database: simple_cms_test pool: 5 username: simple_cms password: vishesh socket: /tmp/mysql.sock

production: adapter: mysql encoding: utf8 reconnect: false database: simple_cms_production pool: 5 username: simple_cms password: vishesh socket: /tmp/mysql.sock

Have you included the mysql2 gem in your gemfile and re-bundled it? Also make sure the database.yml is properly indented.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM