ruby - 在 heroku 上启动应用程序时出错

标签 ruby git ssl heroku sinatra

我正在学习教程 here : 我已经完成了所有步骤。我的应用程序有一个 config.ru、一个 gemfile 和一个只说开始的文件!这只是为了测试在 heroku 上运行的应用程序,看看它是如何处理的。遗憾的是,我遇到了一个非常奇怪的错误。

下面是我按照教程的git push

git push heroku master
Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 596 bytes, done.
Total 5 (delta 4), reused 0 (delta 0)

-----> Heroku receiving push
-----> Ruby/Rack app detected
-----> Installing dependencies using Bundler version 1.1.rc.7
       Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
       Using i18n (0.6.0)
       Using multi_json (1.1.0)
       Using activesupport (3.2.2)
       Using builder (3.0.0)
       Using activemodel (3.2.2)
       Using bson (1.6.0)
       Using mongo (1.6.0)
       Using plucky (0.4.4)
       Using mongo_mapper (0.11.0)
       Using rack (1.4.1)
       Using rack-protection (1.2.0)
       Using tilt (1.3.3)
       Using sinatra (1.3.2)
       Using bundler (1.1.rc.7)
       Your bundle is complete! It was installed into ./vendor/bundle
       Cleaning up the bundler cache.
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for Ruby/Rack -> console, rake, web
-----> Compiled slug size is 3.7MB
-----> Launching... done, v5
       http://myapp.herokuapp.com deployed to Heroku

To git@heroku.com:myapp.git
   d799d9c..93d7d15  master -> master

看起来很简单。但是 heroku ps 给出了

Process  State           Command                               
-------  --------------  ------------------------------------  
web.1    crashed for 4s  bundle exec rackup config.ru -p $P.. 

当然,我检查了日志,但它们也可能是阿 pull 伯语。

/

usr/lib/ruby/1.9.1/net/http.rb:678:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
    from /usr/lib/ruby/1.9.1/net/http.rb:678:in `block in connect'
    from /usr/lib/ruby/1.9.1/timeout.rb:44:in `timeout'
    from /usr/lib/ruby/1.9.1/timeout.rb:89:in `timeout'
    from /usr/lib/ruby/1.9.1/net/http.rb:678:in `connect'
    from /usr/lib/ruby/1.9.1/net/http.rb:637:in `do_start'
    from /usr/lib/ruby/1.9.1/net/http.rb:626:in `start'
    from /usr/local/heroku/lib/heroku/client.rb:409:in `read_logs'
    from /usr/local/heroku/lib/heroku/command/logs.rb:31:in `index'
    from /usr/local/heroku/lib/heroku/command.rb:135:in `run'
    from /usr/local/heroku/lib/heroku/cli.rb:9:in `start'
    from /usr/bin/heroku:30:in `<main>'

我确实认为 heroku 在 ruby​​ 1.9.2 上运行应用程序,但这并不重要。看来我缺少某种 ssl 证书或变量。我绝对没有在我的“go.rb”脚本中使用任何基于 SSL 的函数,但它似乎仍然需要一些东西。

谁能给我指出正确的方向?


配置.ru

require './go'
run Sinatra::Application

最佳答案

这个问题确实困扰了我一段时间。我仍然没有找到问题的根源,但它已经修复并且没有重新出现。

sinatra 应用程序无法启动。查看日志后,发现SSL这个词经常 pop

我写了另一个小程序只是为了在 Heroku 上测试,它有同样的错误。

我遵循了教程 here它似乎解决了错误。

关于ruby - 在 heroku 上启动应用程序时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9548769/

相关文章:

ruby - 无法编译 ruby​​ 1.9.3

mysql - Ruby 脚本在 sql 查询完成之前结束

oracle - ssl_error_rx_record_too_long

ssl - 你如何让 Mozilla FireFox 接受你的根证书颁发机构 ssl 证书,这样它就不会提示 https 上的自签名 ssl 证书?

ruby-on-rails - 在 Rails 3 中使用 Cucumber/Capybara 测试 jQuery 标记自动完成

ruby - 安装rvm后如何安装系统ruby

git - SSH 从远程服务器推送到 git

git - 正确推送 git 子模块

git - 您如何查看哪个提交从 repo 协议(protocol)中删除了文件?

visual-studio - 使用 Fiddler 和 HTTPS 从远程计算机连接到 Visual Studio 服务器