2016-04-21 59 views
0

我刚刚发起了Rails新的Rails应用,将默认数据库设置更改为PostgresSQL。我开始斌/轨道S中的服务器,我得到这个奇怪的Rails真的很奇怪Rails服务器上的问题

2016-04-21 05:00:33] INFO WEBrick 1.3.1 
[2016-04-21 05:00:33] INFO ruby 2.1.3 (2014-09-19) [i686-linux] 
[2016-04-21 05:00:33] INFO WEBrick::HTTPServer#start: pid=12160 port=3000 


Started GET "/socket.io/?EIO=3&transport=polling&t=LGtCFqz" for 10.0.2.2 at 2016-04-21 05:00:38 +0000 

ActionController::RoutingError (No route matches [GET] "/socket.io"): 
    actionpack (4.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' 
    actionpack (4.1.6) 

lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 
    railties (4.1.6) lib/rails/rack/logger.rb:38:in `call_app' 
    railties (4.1.6) lib/rails/rack/logger.rb:20:in `block in call' 
    activesupport (4.1.6) lib/active_support/tagged_logging.rb:68:in `block in tagged' 
    activesupport (4.1.6) lib/active_support/tagged_logging.rb:26:in `tagged' 
    activesupport (4.1.6) lib/active_support/tagged_logging.rb:68:in `tagged' 
    railties (4.1.6) lib/rails/rack/logger.rb:20:in `call' 
    actionpack (4.1.6) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
    rack (1.5.5) lib/rack/methodoverride.rb:21:in `call' 
    rack (1.5.5) lib/rack/runtime.rb:17:in `call' 
    activesupport (4.1.6) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call' 
    rack (1.5.5) lib/rack/lock.rb:17:in `call' 
    actionpack (4.1.6) lib/action_dispatch/middleware/static.rb:64:in `call' 
    rack (1.5.5) lib/rack/sendfile.rb:112:in `call' 
    railties (4.1.6) lib/rails/engine.rb:514:in `call' 
    railties (4.1.6) lib/rails/application.rb:144:in `call' 
    rack (1.5.5) lib/rack/lock.rb:17:in `call' 
    rack (1.5.5) lib/rack/content_length.rb:14:in `call' 
    rack (1.5.5) lib/rack/handler/webrick.rb:60:in `service' 
    /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service' 
    /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run' 
    /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread' 

此行的堆栈跟踪真的令我担忧:

Started GET "/socket.io/?EIO=3&transport=polling&t=LGtCFqz" for 10.0.2.2 at 2016-04-21 05:00:38 +0000 

我有一个WebSocket的宝石安装名为EM-的WebSockets以及作为薄宝石。我从Ruby卸载,但我仍然得到这个错误。

source 'https://rubygems.org' 

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '4.1.6' 
# postgres db 
gem 'pg' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 4.0.3' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 
# Use CoffeeScript for .js.coffee assets and views 
gem 'coffee-rails', '~> 4.0.0' 
# See https://github.com/sstephenson/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use jquery as the JavaScript library 
gem 'jquery-rails' 
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 
gem 'turbolinks' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.0' 
# bundle exec rake doc:rails generates the API under doc/api. 
gem 'sdoc', '~> 0.4.0',   group: :doc 

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
gem 'spring',  group: :development 

# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# Use unicorn as the app server 
# gem 'unicorn' 

# Use Capistrano for deployment 
# gem 'capistrano-rails', group: :development 

# Use debugger 
# gem 'debugger', group: [:development, :test] 

这是我的gemfile。据我所知,它与websockets没有任何关系。有没有人有这方面的见解?

谢谢。

+0

你有没有在你的前端运行某种[Socket.io](http://socket.io)代码?您的计算机上可能访问相同端口的另一个应用程序? – tadman

+0

这可能是我以前玩过流星,流星不会杀死端口吗? – powerup7

+1

如果你仍然有一个Meteor页面打开,它可能会戳你的Rails服务器,认为它可以再次连接。这就是为什么我喜欢使用[Pow](http://pow.cx),它使每个应用程序分离。 – tadman

回答

1

我重新启动并重新启动服务器的默认导轨(0.0.0.0:3000)。 它固定自己。

感谢您的帮助。