我正在做一个使用私人 pub gem 工作的应用程序,它在 localhost 上运行正常,但当我将它部署到 heroku 时却不行。我认为这个问题是 Heroku 上的 HTTPS 协议。我已经尝试了几乎所有在 Heroku 上运行的方法,但我还没有找到解决方案。之前有人已经让私人酒吧通过 HTTPS 运行了吗?
证书受浏览器信任。我正在 Opera 和 Chrome 上进行测试。如果我在 heroku 上更改为 http,文件 faye.js 将被阻止并且不会加载。当我在 heroku 上运行瘦服务器时,我收到错误消息:“确定你不是在寻找 /faye 吗?”,当我没有通过 procfile 加载瘦服务器时,当聊天加载时,浏览器上出现 js 错误: application-2563428….js:19064 GET myapp.herokuapp.com/faye.js
我的设置是:
private_pub.yml (/config)
development:
server: "http://localhost:9292/faye"
secret_token: "secret"
test:
server: "http://localhost:9292/faye"
secret_token: "secret"
production:
server: "https://my.app.com/faye"
secret_token: "c2c373dd2d7b8d080311d4d32f9710a7c01ee627c30a75ec1143559b74a82c75"
signature_expiration: 86400 # one day
private_pub.ru (/)
require "bundler/setup"
require "yaml"
require "faye"
require "private_pub"
Faye::WebSocket.load_adapter('thin')
PrivatePub.load_config(File.expand_path("../config/private_pub.yml", __FILE__), ENV["RAILS_ENV"] || "production")
run PrivatePub.faye_app
一个人在这里成功了,但我仍然不知道如何。
谢谢!