无法启动rails服务器 - 谷歌搜索没有运气

时间:2014-09-18 15:23:35

标签: ruby-on-rails

尝试启动rails服务器以完成Kehoe的“Learn Ruby on Rails”并不断收到心理错误,并且不知道如何排除故障。

这是输出:

/Dropbox/workspace/learn-rails$ rails s
/home/mark/.rvm/gems/ruby-2.1.2@global/gems/psych-2.0.6/lib/psych.rb:370:in `parse': (<unknown>): mapping values are not allowed in this context at line 6 column 15 (Psych::SyntaxError)
from /home/mark/.rvm/gems/ruby-2.1.2@global/gems/psych-2.0.6/lib/psych.rb:370:in `parse_stream'
from /home/mark/.rvm/gems/ruby-2.1.2@global/gems/psych-2.0.6/lib/psych.rb:318:in `parse'
from /home/mark/.rvm/gems/ruby-2.1.2@global/gems/psych-2.0.6/lib/psych.rb:245:in `load'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/figaro-1.0.0/lib/figaro/application.rb:60:in `parse'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/figaro-1.0.0/lib/figaro/application.rb:56:in `block in raw_configuration'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/figaro-1.0.0/lib/figaro/application.rb:56:in `yield'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/figaro-1.0.0/lib/figaro/application.rb:56:in `raw_configuration'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/figaro-1.0.0/lib/figaro/application.rb:64:in `global_configuration'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/figaro-1.0.0/lib/figaro/application.rb:32:in `configuration'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/figaro-1.0.0/lib/figaro/application.rb:42:in `each'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/figaro-1.0.0/lib/figaro/application.rb:36:in `load'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/figaro-1.0.0/lib/figaro.rb:23:in `load'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/figaro-1.0.0/lib/figaro/rails/railtie.rb:5:in `block in <class:Railtie>'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:36:in `call'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/railties-4.1.6/lib/rails/application.rb:123:in `initialize'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/railties-4.1.6/lib/rails/railtie.rb:171:in `new'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/railties-4.1.6/lib/rails/railtie.rb:171:in `instance'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/railties-4.1.6/lib/rails/application.rb:90:in `inherited'
from /home/mark/Dropbox/workspace/learn-rails/config/application.rb:10:in `<module:LearnRails>'
from /home/mark/Dropbox/workspace/learn-rails/config/application.rb:9:in `<top (required)>'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:79:in `require'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `server'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /home/mark/.rvm/gems/ruby-2.1.2@learn-rails/gems/railties-4.1.6/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:8:in `require'
from bin/rails:8:in `<main>'

2 个答案:

答案 0 :(得分:2)

Psych是一个YAML解析器和发射器。我猜你要么编码格式错误database.yml,要么编码错误。

答案 1 :(得分:2)

鉴于Psych是用于处理YAML文件的gem,并且您的错误指示语法错误,因此您config/目录中的某个位置存在格式错误的YAML文件的可能性非常大。