我正在关注http://fdv.github.io/publify/#publifydemo上的教程,但它所说的只是
- 将 database.yml.yourEngine 重命名为 database.yml
- 编辑 database.yml 以添加您的数据库名称、登录名和密码。
所以我将 database.postgresql.yml 重命名为 database.yml 至于添加登录名和密码,我做到了,这是文件
login: &login
adapter: postgresql
host: localhost
username: troll
development:
encoding: unicode
database: typo_dev
username: troll
password: lol
host: localhost:3000
test:
encoding: unicode
database: typo_dev
username: troll
password: lol
host: localhost:3000
production:
database: typo
username: troll
password: lol
host: <hostname or ip address. eg.: localhost>
不太确定从这里去哪里。我确实搜索了PostgreSQL 的文档,但不确定从手册的 2808 页从哪里开始。
我确实遇到了这个问题How to configure Postgresql with rails project? 但它仍然没有在本地运行
这是我运行 rails server 时的日志
jgallardo:bruxir-typo juan.gallardo$ rails server
/Users/juan.gallardo/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): found character that cannot start any token while scanning for the next token at line 2 column 3 (Psych::SyntaxError)
from /Users/juan.gallardo/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
from /Users/juan.gallardo/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/psych.rb:153:in `parse'
from /Users/juan.gallardo/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/psych.rb:129:in `load'
from /Users/juan.gallardo/Desktop/myfiles/test-projects/typo/bruxir-typo/Gemfile:7:in `eval_gemfile'
from /Users/juan.gallardo/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/dsl.rb:30:in `instance_eval'
from /Users/juan.gallardo/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/dsl.rb:30:in `eval_gemfile'
from /Users/juan.gallardo/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/dsl.rb:9:in `evaluate'
from /Users/juan.gallardo/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/definition.rb:19:in `build'
from /Users/juan.gallardo/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler.rb:148:in `definition'
from /Users/juan.gallardo/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler.rb:136:in `load'
from /Users/juan.gallardo/.rvm/gems/ruby-2.0.0-p195/gems/bundler-unload-1.0.1/lib/bundler-unload.rb:42:in `with_bundle'
from /Users/juan.gallardo/.rvm/gems/ruby-2.0.0-p195/gems/rubygems-bundler-1.2.2/lib/rubygems-bundler/noexec.rb:53:in `candidate?'
from /Users/juan.gallardo/.rvm/gems/ruby-2.0.0-p195/gems/rubygems-bundler-1.2.2/lib/rubygems-bundler/noexec.rb:70:in `setup'
from /Users/juan.gallardo/.rvm/gems/ruby-2.0.0-p195/gems/rubygems-bundler-1.2.2/lib/rubygems-bundler/noexec.rb:85:in `<top (required)>'
from /Users/juan.gallardo/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:116:in `require'
from /Users/juan.gallardo/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:116:in `rescue in require'
from /Users/juan.gallardo/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:122:in `require'
from /Users/juan.gallardo/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:9:in `<main>'