gpt4 book ai didi

ruby-on-rails - Ruby Rails - Cloud9 - (SocketError)

转载 作者:可可西里 更新时间:2023-11-01 02:43:26 26 4
gpt4 key购买 nike

尝试在 C9.io 中启动我的 Rails 应用程序时,我看到下面的套接字错误。我不确定如何纠正这个问题。有什么想法吗?

  • ruby 2.3.0p0(2015-12-25 修订版 53290)[x86_64-linux]
  • rails 4.2.5
  • Cloud9 集成开发环境

    blacknight659:~/jh_projects/mybay2 $ rails s -b -$IP -p -$PORT

    => 启动 WEBrick=> Rails 4.2.5 应用程序开始开发 http://-0.0.0.0:-8080=> 运行 rails server -h更多启动选项=> Ctrl-C 关闭服务器[2016-07-26 17:43:06] 信息 WEBrick 1.3.1[2016-07-26 17:43:06] INFO ruby​​ 2.3.0 (2015-12-25) [x86_64-linux]退出/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:231:in getaddrinfo': getaddrinfo: Servname not supported for ai_socktype (SocketError)
    from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:231:in
    foreach' 来自/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:757:in tcp_server_sockets'
    from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/utils.rb:65:in
    创建_listeners' 来自/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/server.rb:134:in listen'
    from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/server.rb:115:in
    初始化' 来自/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/httpserver.rb:47:in initialize'
    from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:31:in
    新的' 来自/usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:31:in run'
    from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:286:in
    开始' 来自/usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands/server.rb:80:in start'
    from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:80:in
    在服务器中阻止' 来自/usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in tap'
    from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in
    服务器' 来自/usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in run_command!'
    from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in
    ' 来自/home/ubuntu/jh_projects/mybay2/bin/rails:9:in require'
    from /home/ubuntu/jh_projects/mybay2/bin/rails:9:in
    ' 来自/usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in load'
    from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in
    称呼' 来自/usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/command.rb:7:in call'
    from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client.rb:30:in
    跑' 来自/usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/bin/spring:49:in <top (required)>'
    from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in
    加载' 来自/usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in <top (required)>'
    from /home/ubuntu/jh_projects/mybay2/bin/spring:13:in
    要求' 来自/home/ubuntu/jh_projects/mybay2/bin/spring:13:in <top (required)>'
    from bin/rails:3:in
    加载' 来自 bin/rails:3:in `'

最佳答案

尝试在 cloud9 上启动我的 Sinatra 应用程序时,我遇到了同样的错误。事实证明,我正在使用根用户 (su) 运行命令:$ bundle exec rackup -p $PORT -o $IP。尝试在普通用户上运行它。

关于ruby-on-rails - Ruby Rails - Cloud9 - (SocketError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38596703/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com