启动Rails服务器时出现Neoid错误

时间:2014-01-30 18:34:21

标签: ruby ruby-on-rails-4 neo4j

看了之后,作为图形数据库的相对新手,我认为Neoid可能是在这个阶段受益于Neo4j的最佳方式。安装它后,我在启动服务器时遇到了问题。我已经安装了gem,添加了github page中所述的01_neo4j.rb文件,将相关列添加到模型中并得到以下错误:

=> Booting WEBrick
=> Rails 4.0.2 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:35:in `initialize': No such file or directory - /dev/null (Errno::ENOENT)
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:35:in `open'

    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:35:in `open'

    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/logger.rb:599:in `create_logfile'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/logger.rb:594:in `open_logfile'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/logger.rb:549:in `initialize'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/logger.rb:314:in `new'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/logger.rb:314:in `initialize'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/neoid-0.1.2/lib/neoid.rb:73:in `new'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/neoid-0.1.2/lib/neoid.rb:73:in `logger'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/neoid-0.1.2/lib/neoid.rb:52:in `initialize_all'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/neoid-0.1.2/lib/neoid/railtie.rb:7:in `block (2 levels) in <class:Railtie>'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:36:in `call'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:44:in `each'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from C:/Sites/Knock4/config/environment.rb:5:in `<top (required)>'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
    from C:/Sites/Knock4/config.ru:3:in `block in <main>'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
    from C:/Sites/Knock4/config.ru:in `new'
    from C:/Sites/Knock4/config.ru:in `<main>'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands/server.rb:48:in `app'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands/server.rb:75:in `start'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

如果有人知道这里可能存在什么问题,我将不胜感激。我正在使用Rails 4.0.2(你可能会看到),所以不确定这是否是一个问题。

错误参考显示以下代码:

def open(name, *rest, &block) # :doc:
  if name.respond_to?(:open)
    name.open(*rest, &block)
  elsif name.respond_to?(:to_str) &&
        %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://} =~ name &&
        (uri = URI.parse(name)).respond_to?(:open)
    uri.open(*rest, &block)
  else
    open_uri_original_open(name, *rest, &block)
  end
end

使用     open_uri_original_open(name,* rest,&amp; block)
第35行。我不知道这意味着什么!

1 个答案:

答案 0 :(得分:0)

这是在Windows上由neoid 0.1.2引起的,假设你在unix上,因此标准记录器重定向到dev / null。所以你必须定义

ENV['NEOID_LOG'] ||= 'true'
ENV['NEOID_LOG_FILE'] ||= 'log/neoid.log'

,日志将在日志文件夹中。