не могу запустить мой сервер rails [linux] - PullRequest
0 голосов
/ 28 мая 2018

При запуске команды сервера rails из каталога, в котором находится мое приложение, я получаю следующее сообщение об ошибке:

=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2018-05-28 15:55:12] INFO  WEBrick 1.3.1
[2018-05-28 15:55:12] INFO  ruby 2.3.1 (2016-04-26) [x86_64-linux-gnu]
Exiting
/usr/lib/ruby/2.3.0/socket.rb:231:in `getaddrinfo': getaddrinfo: Name or service not known (SocketError)
    from /usr/lib/ruby/2.3.0/socket.rb:231:in `foreach'
    from /usr/lib/ruby/2.3.0/socket.rb:757:in `tcp_server_sockets'
    from /usr/lib/ruby/2.3.0/webrick/utils.rb:65:in `create_listeners'
    from /usr/lib/ruby/2.3.0/webrick/server.rb:134:in `listen'
    from /usr/lib/ruby/2.3.0/webrick/server.rb:115:in `initialize'
    from /usr/lib/ruby/2.3.0/webrick/httpserver.rb:47:in `initialize'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/rack-1.6.10/lib/rack/handler/webrick.rb:31:in `new'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/rack-1.6.10/lib/rack/handler/webrick.rb:31:in `run'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/rack-1.6.10/lib/rack/server.rb:287:in `start'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/railties-4.2.0/lib/rails/commands/server.rb:80:in `start'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
    from /home/jack/Desktop/Rails/MegsBlog/bin/rails:9:in `require'
    from /home/jack/Desktop/Rails/MegsBlog/bin/rails:9:in `<top (required)>'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
    from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/jack/Desktop/Rails/MegsBlog/bin/spring:15:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'

1 Ответ

0 голосов
/ 28 мая 2018

Попробуйте добавить 127.0.0.1 localhost в файл /etc/hosts.Также всегда запускайте команду rails server, используя bundle -> bundle exec rails server.

...