我在我的Rails应用程序中添加了即时聊天(如Gmail聊天),我正在使用private_pub和faye。该应用似乎目前工作,但用户刷新页面后只能看到消息。我检查了元素,它显示faye.js被阻止。确切的错误是private_pub Faye.js被阻止
Mixed Content: The page at 'https://....' was loaded over HTTPS, but requested an insecure script 'http://localhost:9292/faye.js'. This request has been blocked; the content must be served over HTTPS.
有没有人exeperienced这样的错误和/或任何想法如何解决此问题?查看附加图片以获取错误的截图。 enter image description here
你可以在application.html.erb中发布你的JS部分吗?看起来你的网站是用https生成的,但是这部分单独通过http有明确的请求。 – coderhs
@Coderhs这是application.html.erb的JS部分'<%= stylesheet_link_tag'application',media:'all','data-turbolinks-track'=> true%> <%= javascript_include_tag'application', 'https://js.stripe.com/v2/','data-turbolinks-track'=> true%> <%= csrf_meta_tags%> <%= tag:meta,name:“stripe-key”,内容:STRIPE_PUBLIC%>' – Alex