无法启动ruby服务器

时间:2013-08-07 06:44:12

标签: ruby-on-rails ruby

无法启动ruby服务器 我有几天尝试启动它,但没有任何帮助 我正在使用mac os mountain lion
红宝石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

3 个答案:

答案 0 :(得分:1)

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

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

答案 1 :(得分:1)

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

username: 'postgresql'
password: ''

答案 2 :(得分:1)

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