Не удается запустить сервер rails - ошибка "Не удалось посмотреть" - Bash - Ubuntu - Windows 10

Проблема в том, что сервер не запустится. Я настроил следующее:

  • Windows 10 build 1607 (юбилейная версия)
  • Подсистема Windows для Linux
  • GNU bash, версия 4.3.11(1)-релиз (x86_64-pc-linux-gnu)
  • Ubuntu 14.04.5 LTS \ n \ l
  • Rails ver 5.0.0.1
  • Ruby ver 2.3.1 (с использованием - rbenv)
  • MySQL 5.5.53

Я очень плохо знаком с Linux и Ruby / Rails, поэтому, пожалуйста, прости меня, если я использую неправильную терминологию.

После нескольких дней установки, настройки и отладки я смог заставить все работать (оболочка Linux, rails, ruby ​​mysql и т. Д.).
Я начал учебный курс в Линде под названием "Основы обучения Ruby on Rails 5" и смог сделать следующее:

  • Создайте новый проект рельсов под названием Simple CMS
  • Создание баз данных MySQL для разработки и тестирования.
  • Создать пользователей в MySQL

** Когда пришло время запустить веб-сервер (Puma с помощью команды 'rails server'), я получил страницы ошибок, как показано. Я искал все результаты stackru, google, Microsoft и GitHub, которые имели какое-либо отношение к "Failed to watch" и вышеупомянутой конфигурации. Решений не было, и в последнем результате говорилось, что запустить сервер из-за способа работы Windows было невозможно. Прежде чем отменить установку, я хотел спросить здесь, сталкивался ли кто-нибудь с этим и / или имел ли решение. Заранее большое спасибо за любую помощь и за то, что нашли время прочитать это. Майк

Вот ошибка, включая команду, которую я использовал для ее инициации:(Извините, это огромно)

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

1 ответ

Нашел решение в комментарии @jwsloan к этой проблеме Github:

При создании нового приложения rails используйте --skip-listen чтобы избежать проблем с inotify, вот так:

rails new myproject --skip-listen

Это должно позволить запустить сервер - у меня работает!:)

Другие вопросы по тегам