当尝试在C9.io中启动我的Rails应用程序时,我看到下面的套接字错误。我不确定如何纠正这个问题。有什么想法吗?
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: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
create_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
new'
来自/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
start'
来自/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: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
load&#39;
来自/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
要求&#39;
来自/ home / ubuntu / jh_projects / mybay2 / bin / spring:13:<top (required)>'
from bin/rails:3:in
加载&#39;
来自bin / rails:3:在`&#39;
答案 0 :(得分:0)
我试图在cloud9上启动我的Sinatra应用程序时遇到了同样的错误。事实证明我正在运行命令:$ bundle exec rackup -p $PORT -o $IP
和root用户(su)。尝试在普通用户上运行它。
答案 1 :(得分:0)
您在ip和port参数前加一个破折号。指定的参数值不带破折号。试试:
https://www.googleapis.com/auth/analytics.readonly