Ruby Rails - Cloud9 - (SocketError)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ruby Rails - Cloud9 - (SocketError)相关的知识,希望对你有一定的参考价值。
当试图在C9.io中启动我的Rails应用程序时,我看到下面的套接字错误。我不确定如何纠正这个问题。有任何想法吗?
- ruby 2.3.0p0(2015-12-25修订版53290)[x86_64-linux]
- Rails 4.2.5
- Cloud9 IDE
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] INFO 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:来自/ usr / local /来自/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:757:来自/ usr / local /的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
create_listeners rvm / rubies / ruby-2.3.0 / lib / ruby / 2.3.0 / webrick / server.rb:134:intcp_server_sockets' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/utils.rb:65:in
initialize'from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3 .0 / webrick / httpserver.rb:47:inlisten' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/server.rb:115:in
new'来自/usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:31:在initialize' from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:31:in
start'来自/usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands/server.rb:80:inrun' from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:286:in
block in server'from / usr / local / rvm / gems / ruby-2.3.0 / gems / railties-4.2.5 / lib / rails / commands / commands_tasks.rb:75:instart' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:80:in
server'来自/ usr / local / rvm / ge ms / ruby-2.3.0 / gems / railties-4.2.5 / lib / rails / commands / commands_tasks.rb:39:intap' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in
'from / home / ubuntu / jh_projects / mybay2 / bin / rails:9:inrun_command!' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in
'来自/usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:inrequire' from /home/ubuntu/jh_projects/mybay2/bin/rails:9:in
call'来自/ usr / local / rvm / gems / ruby -2.3.0 / gems / spring-1.7.2 / lib / spring / client / command.rb:7:inload' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in
run'from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7。 2 / bin / spring:49:在call' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/client.rb:30:in
load'来自/usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in<top (required)>' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in
require'来自/ home / ubuntu / jh_projects / mybay2 / bin / spring:13:在<top (required)>' from /home/ubuntu/jh_projects/mybay2/bin/spring:13:in
load'来自bin / rails:3:in''
答案
尝试在cloud9上启动我的Sinatra应用程序时出现了同样的错误。事实证明我正在运行命令:<top (required)>'
from bin/rails:3:in
和root用户(su)。尝试在普通用户上运行它。
以上是关于Ruby Rails - Cloud9 - (SocketError)的主要内容,如果未能解决你的问题,请参考以下文章
text Cloud9上的Rails + PostgreSQL
Ruby on Rails 表单中的 select 和 onChange