我就收到了此错误

我就收到了此错误

本文介绍了我已经在openshift上托管了服务器端("Node js"和"Express js")代码,从一个星期开始,我就收到了此错误.如何克服呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在网站上,几乎所有API都显示此错误

In the website it is showing this error for almost all APIs

Failed to load resource: the server responded with a status of 502 (Proxy Error)

XMLHttpRequest cannot load. No 'Access-Control-Allow-Origin' header is present on the
requested resource. Origin is therefore not allowed access. The response had
HTTP status code 503.

注意::CORS已使用npm安装,但仍然出现上述错误.

NOTE:CORS has been already installed using npm but still getting the above error.

有时会收到此错误

Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING

使用rhc tail命令检查的日志位于日志下方

When checked log using rhc tail command got below log

C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/ssh/ruby_comp
at.rb:20:in `select': closed stream (IOError)
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/ruby_compat.rb:20:in `io_select'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/transport/packet_stream.rb:75:in `available_for_read?'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/transport/packet_stream.rb:87:in `next_packet'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/transport/session.rb:193:in `block in poll_message'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/transport/session.rb:188:in `loop'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/transport/session.rb:188:in `poll_message'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/session.rb:513:in `dispatch_incoming_packets'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/session.rb:237:in `ev_preprocess'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/event_loop.rb:95:in `each'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/event_loop.rb:95:in `ev_preprocess'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/event_loop.rb:27:in `process'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/session.rb:216:in `process'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/session.rb:178:in `block in loop'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/session.rb:178:in `loop'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh/connection/session.rb:178:in `loop'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/ssh_helpe
rs.rb:198:in `block in ssh_ruby'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/net-ssh-4.0.0.beta3/lib/net/
ssh.rb:245:in `start'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/ssh_helpe
rs.rb:173:in `ssh_ruby'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/commands/
tail.rb:40:in `tail'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/commands/
tail.rb:21:in `run'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/commands.
rb:294:in `execute'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/commands.
rb:285:in `block (3 levels) in to_commander'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/commander-4.2.1/lib/commande
r/command.rb:180:in `call'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/commander-4.2.1/lib/commande
r/command.rb:180:in `call'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/commander-4.2.1/lib/commande
r/command.rb:155:in `run'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/commander-4.2.1/lib/commande
r/runner.rb:421:in `run_active_command'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/command_r
unner.rb:72:in `run!'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/commander-4.2.1/lib/commande
r/delegates.rb:8:in `run!'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/lib/rhc/cli.rb:37
:in `start'
    from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rhc-1.38.7/bin/rhc:20:in `<t
op (required)>'
    from C:/Ruby21-x64/bin/rhc:23:in `load'
    from C:/Ruby21-x64/bin/rhc:23:in `<main>'

我在哪里做错了?

推荐答案

我觉得您安装了错误的Ruby版本.我认为只有1.86至2.0版本有效.卸载Ruby,然后重新安装早期版本.

I have a feeling you have installed the wrong Ruby version. I think only version 1.86 thru 2.0 works. Uninstall Ruby and reinstall earlier version.

这篇关于我已经在openshift上托管了服务器端("Node js"和"Express js")代码,从一个星期开始,我就收到了此错误.如何克服呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 18:58