![](/img/trans.png)
[英]Ruby on Rails - Keep getting a error when trying to run "rake db:migrate"
[英]rails 3.1.3: rake aborts (couldn't parse YAML) when run first db:migrate (trying to run postgres locally on mac lion)
對於一個新項目,我正在嘗試在本地運行 postgres。
Mac Lion 安裝了 Postgres (9.1.2)。 我修改了 in.bash_profile 中的路徑(根據另一個 SO 線程),所以現在我可以毫不費力地使用 psql 實用程序創建數據庫或用戶。
我使用env ARCHFLAGS="-arch x86_64" gem install pg
根據http://blog.willj.net/2011/05/31/setting-up上的優秀博客卸載並重新安裝了 pg gem (0.13.2) -postgresql-for-ruby-on-rails-development-on-os-x/
My Gemfile 使用 pg gem 進行開發、測試和生產。 我已經運行了捆綁安裝。
我的 database.yml 看起來像這樣(用戶名和數據庫名稱是正確的,我驗證了我可以使用 psql 實用程序訪問該用戶名的數據庫):
development:
adapter: postgresql
encoding: unicode
database: ddchart_development
pool: 5
username: ddchart
password:
(測試和生產相同,除了 _test 和 _production。密碼為空,對嗎?)
當我運行bundle exec rake db:migrate
時,它中止了:
rake aborted!
couldn't parse YAML at line 8 column 10
任何幫助,將不勝感激!
如果您正確粘貼代碼,則代碼中存在錯誤。 例如,“adapter”之前只有一個空格,但在后續行之前有兩個空格。
在 YAML 中,縮進很重要。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.