Ruby On Rails服务器问题(Windows 10上的Ubuntu Bash)

时间:2017-03-13 23:46:33

标签: ruby-on-rails ruby windows-10

在另一个Notes on client-side routing我解释说我是新手RoR。我有美洲狮3.8.0宝石的问题然后我降级到固定的一个问题。但是,它造成了另一个问题:

/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/app_loader.rb:40: warning: Insecure world writable dir /root/.rbenv/versions in PATH, mode 040777
=> Booting Puma
=> Rails 5.0.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Exiting
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-inotify-0.9.8/lib/rb-inotify/watcher.rb:74:in `initialize': Invalid argument - Failed to watch "/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/locale": the given event mask contains no legal events; or fd is not an inotify file descriptor. (Errno::EINVAL)
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-inotify-0.9.8/lib/rb-inotify/notifier.rb:190:in `new'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-inotify-0.9.8/lib/rb-inotify/notifier.rb:190:in `watch'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rb-inotify-0.9.8/lib/rb-inotify/notifier.rb:208:in `watch'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/adapter/linux.rb:32:in `_configure'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:45:in `block in configure'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `each'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:40:in `configure'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/adapter/base.rb:63:in `start'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/backend.rb:28:in `start'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/listener.rb:67:in `block in <class:Listener>'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `instance_eval'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/fsm.rb:120:in `call'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/fsm.rb:91:in `transition_with_callbacks!'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/fsm.rb:57:in `transition'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/listen-3.0.8/lib/listen/listener.rb:90:in `start'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/evented_file_update_checker.rb:90:in `boot!'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/evented_file_update_checker.rb:61:in `initialize'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/i18n_railtie.rb:59:in `new'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/i18n_railtie.rb:59:in `initialize_i18n'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/i18n_railtie.rb:15:in `block in <class:Railtie>'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:41:in `execute_hook'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:49:in `each'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.0.2/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/application/finisher.rb:65:in `block in <module:Finisher>'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `instance_exec'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/initializable.rb:30:in `run'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
    from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
    from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
    from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:347:in `each'
    from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:347:in `call'
    from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
    from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
    from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/initializable.rb:54:in `run_initializers'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/application.rb:352:in `initialize!'
    from /root/appnew/config/environment.rb:5:in `<top (required)>'
    from /root/appnew/config.ru:3:in `require_relative'
    from /root/appnew/config.ru:3:in `block in <main>'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
    from /root/appnew/config.ru:in `new'
    from /root/appnew/config.ru:in `<main>'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/server.rb:59:in `app'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/server.rb:124:in `log_to_stdout'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/server.rb:77:in `start'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:90:in `block in server'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
    from /root/appnew/bin/rails:9:in `require'
    from /root/appnew/bin/rails:9:in `<top (required)>'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/bin/spring:49:in `<top (required)>'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
    from /root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `<top (required)>'
    from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /root/.rbenv/versions/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /root/appnew/bin/spring:15:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'

我不太确定我在看什么?希望有人能指出我正确的方向。

1 个答案:

答案 0 :(得分:1)

根据https://github.com/rails/rails/issues/26054,您可以创建一个应用程序:

rails new --skip-spring --skip-listen APP_NAME

如上面的链接所述,这应该在Windows 10 Insider版本&gt; = 14942中修复。

我使用上面的命令rails server工作来创建我的rails应用程序。

我的ruby版本是2.4.0p0,rails版本是5.1.0.beta1和puma版本3.7.1。