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沒有任何關係。有沒有人有這方面的見解?
謝謝。
你有沒有在你的前端運行某種[Socket.io](http://socket.io)代碼?您的計算機上可能訪問相同端口的另一個應用程序? – tadman
這可能是我以前玩過流星,流星不會殺死端口嗎? – powerup7
如果你仍然有一個Meteor頁面打開,它可能會戳你的Rails服務器,認爲它可以再次連接。這就是爲什麼我喜歡使用[Pow](http://pow.cx),它使每個應用程序分離。 – tadman