2

无法启动 ruby​​ 服务器
我有好几天尝试启动它,但没有任何帮助
我使用 mac os mountain lion
ruby​​ 1.9.3-p429
可能是因为错误的 postgres 用户或密码?告诉我,database.ylm 是否自动连接到 ruby​​?

这是输出:`

rails s puma
WARNING: Nokogiri was built against LibXML version 2.9.1, but has dynamically loaded 2.7.8
=> Booting Puma
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/psych-1.3.4/lib/psych.rb:203:in 'parse': (<unknown>): could not find expected ':' while scanning a simple key at line 6 column 3 (Psych::SyntaxError)
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/psych-1.3.4/lib/psych.rb:203:in `parse_stream'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/psych-1.3.4/lib/psych.rb:151:in `parse'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/psych-1.3.4/lib/psych.rb:127:in `load'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/application/configuration.rb:115:in `database_configuration'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/activerecord-3.2.13/lib/active_record/railtie.rb:78:in `block (2 levels) in <class:Railtie>'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in `each'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/activerecord-3.2.13/lib/active_record/railtie.rb:74:in `block in <class:Railtie>'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/Padampam/Desktop/networkoflearning/config/environment.rb:5:in `<top (required)>'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/Padampam/Desktop/networkoflearning/config.ru:3:in `block in <main>'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/Padampam/Desktop/networkoflearning/config.ru:in `new'
from /Users/Padampam/Desktop/networkoflearning/config.ru:in `<main>'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/Padampam/.rvm/gems/ruby-1.9.3-p429@soukthemooc/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in 'require'
from script/rails:6:in <main>'`

这是database.yml

development: &development
  adapter: postgresql
  encoding: unicode
  database: soukthemooc_development
  pool: 25
  username: 'postgres'
  password: ''
  host: localhost
  port: 5432
  min_messages: WARNING

test:
  <<: *development
  database: soukthemooc_test
  min_messages: WARNING
4

3 回答 3

1

如果您有多个服务器运行问题。请参阅此 http://samionrails.blogspot.com/2013/04/rails-32-multiple-server-issue.html

于 2013-08-07T07:53:00.870 回答
1

检查您的 YAML 配置文件,您可能在其中一个中有错字。

这可以帮助您调试 YAML 文件:http: //yaml-online-parser.appspot.com/

于 2013-08-07T06:58:34.060 回答
1

您必须在 YAML 中的键和值之间放置一个空格:

username: 'postgresql'
password: ''
于 2013-08-07T07:00:04.737 回答