- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
config.ru
require './app'
run Sinatra::Application
gem 文件
source 'http://rubygems.org'
gem 'heroku'
gem 'sinatra'
gem 'thin'
配置文件
web: bundle exec rackup config.ru -p $PORT
这是我的 heroku 日志
2013-08-10T01:21:03.753984+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2013-08-10T01:21:03.754180+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:250:in `start'
2013-08-10T01:21:03.754180+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:141:in `start'
2013-08-10T01:21:03.754180+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2013-08-10T01:21:04.799863+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-10T01:21:04.790161+00:00 heroku[web.1]: Process exited with status 1
2013-08-10T01:21:25.615653+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=beer-voter.herokuapp.com fwd="98.173.1.66" dyno= connect= service= status=503 bytes=
2013-08-10T01:22:57.223684+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=beer-voter.herokuapp.com fwd="98.173.1.66" dyno= connect= service= status=503 bytes=
2013-08-10T01:24:34.417907+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by jgallardo720@gmail.com
2013-08-10T01:24:39.051510+00:00 heroku[run.1200]: Awaiting client
2013-08-10T01:24:39.073013+00:00 heroku[run.1200]: Starting process with command `bundle exec rake db:migrate`
2013-08-10T01:24:41.746057+00:00 heroku[run.1200]: State changed from starting to up
2013-08-10T01:24:46.002914+00:00 heroku[run.1200]: Process exited with status 1
2013-08-10T01:24:46.018585+00:00 heroku[run.1200]: State changed from up to complete
2013-08-10T01:26:31.150052+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=beer-voter.herokuapp.com fwd="98.173.1.66" dyno= connect= service= status=503 bytes=
2013-08-10T01:29:07.598813+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-10T01:29:11.616194+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 26270`
2013-08-10T01:29:15.827320+00:00 app[web.1]: /app/config.ru:1:in `require': cannot load such file -- ./app (LoadError)
2013-08-10T01:29:15.827320+00:00 app[web.1]: from /app/config.ru:1:in `block in <main>'
2013-08-10T01:29:15.827320+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2013-08-10T01:29:15.827320+00:00 app[web.1]: from /app/config.ru:in `new'
2013-08-10T01:29:15.827320+00:00 app[web.1]: from /app/config.ru:in `<main>'
2013-08-10T01:29:15.827320+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2013-08-10T01:29:15.827320+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2013-08-10T01:29:15.827320+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2013-08-10T01:29:15.827320+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2013-08-10T01:29:15.827320+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2013-08-10T01:29:15.827512+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2013-08-10T01:29:15.827512+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2013-08-10T01:29:15.827512+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:250:in `start'
2013-08-10T01:29:15.827512+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:141:in `start'
2013-08-10T01:29:15.827512+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/rackup:23:in `load'
2013-08-10T01:29:15.827512+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/bin/rackup:4:in `<top (required)>'
2013-08-10T01:29:15.827799+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/rackup:23:in `<main>'
2013-08-10T01:29:17.475127+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-10T01:29:17.455240+00:00 heroku[web.1]: Process exited with status 1
2013-08-10T01:39:12.643653+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-10T01:39:15.630798+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 26323`
2013-08-10T01:39:17.108286+00:00 app[web.1]: from /app/config.ru:1:in `block in <main>'
2013-08-10T01:39:17.108286+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2013-08-10T01:39:17.108286+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2013-08-10T01:39:17.108286+00:00 app[web.1]: from /app/config.ru:in `new'
2013-08-10T01:39:17.108286+00:00 app[web.1]: from /app/config.ru:in `<main>'
2013-08-10T01:39:17.108286+00:00 app[web.1]: /app/config.ru:1:in `require': cannot load such file -- ./app (LoadError)
2013-08-10T01:39:17.108286+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2013-08-10T01:39:17.108286+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2013-08-10T01:39:17.108286+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2013-08-10T01:39:17.108286+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2013-08-10T01:39:17.108500+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2013-08-10T01:39:17.108500+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2013-08-10T01:39:17.108500+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:250:in `start'
2013-08-10T01:39:17.108500+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:141:in `start'
2013-08-10T01:39:17.108500+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/bin/rackup:4:in `<top (required)>'
2013-08-10T01:39:17.108500+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/rackup:23:in `load'
2013-08-10T01:39:17.108500+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/rackup:23:in `<main>'
2013-08-10T01:39:18.608414+00:00 heroku[web.1]: Process exited with status 1
2013-08-10T01:39:18.624453+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-10T01:49:20.129509+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-10T01:49:25.310821+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 31607`
2013-08-10T01:49:29.293008+00:00 app[web.1]: from /app/config.ru:1:in `block in <main>'
2013-08-10T01:49:29.293008+00:00 app[web.1]: /app/config.ru:1:in `require': cannot load such file -- ./app (LoadError)
2013-08-10T01:49:29.293008+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2013-08-10T01:49:29.293008+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2013-08-10T01:49:29.293008+00:00 app[web.1]: from /app/config.ru:in `new'
2013-08-10T01:49:29.293008+00:00 app[web.1]: from /app/config.ru:in `<main>'
2013-08-10T01:49:29.293225+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2013-08-10T01:49:29.293008+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2013-08-10T01:49:29.293008+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2013-08-10T01:49:29.293008+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2013-08-10T01:49:29.293225+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2013-08-10T01:49:29.293225+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/bin/rackup:4:in `<top (required)>'
2013-08-10T01:49:29.293225+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:141:in `start'
2013-08-10T01:49:29.293225+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/rackup:23:in `load'
2013-08-10T01:49:29.293008+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2013-08-10T01:49:29.293225+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/rackup:23:in `<main>'
2013-08-10T01:49:29.293225+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:250:in `start'
2013-08-10T01:49:30.776901+00:00 heroku[web.1]: Process exited with status 1
2013-08-10T01:49:30.787136+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-10T01:59:30.949128+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-10T01:59:34.018512+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 53386`
2013-08-10T01:59:35.253202+00:00 app[web.1]: /app/config.ru:1:in `require': cannot load such file -- ./app (LoadError)
2013-08-10T01:59:35.253202+00:00 app[web.1]: from /app/config.ru:1:in `block in <main>'
2013-08-10T01:59:35.253202+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2013-08-10T01:59:35.253202+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2013-08-10T01:59:35.253202+00:00 app[web.1]: from /app/config.ru:in `new'
2013-08-10T01:59:35.253202+00:00 app[web.1]: from /app/config.ru:in `<main>'
2013-08-10T01:59:35.253202+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2013-08-10T01:59:35.253202+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2013-08-10T01:59:35.253202+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2013-08-10T01:59:35.253202+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2013-08-10T01:59:35.253385+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2013-08-10T01:59:35.253385+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:250:in `start'
2013-08-10T01:59:35.253385+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:141:in `start'
2013-08-10T01:59:35.253385+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/bin/rackup:4:in `<top (required)>'
2013-08-10T01:59:35.253385+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/rackup:23:in `load'
2013-08-10T01:59:35.253385+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/bin/rackup:23:in `<main>'
2013-08-10T01:59:36.518901+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-10T01:59:36.501648+00:00 heroku[web.1]: Process exited with status 1
2013-08-10T01:59:35.253385+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2013-08-10T02:00:18.345271+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=beer-voter.herokuapp.com fwd="98.173.1.66" dyno= connect= service= status=503 bytes=
2013-08-10T02:02:01.913591+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=beer-voter.herokuapp.com fwd="98.173.1.66" dyno= connect= service= status=503 bytes=
是的,这个应用程序在本地运行
当我运行 heroku ps
时出现此错误
=== web (1X): `bundle exec rackup config.ru -p $PORT`
web.1: crashed 2013/08/09 19:10:11 (~ 8m ago)
最佳答案
这两行似乎说明了问题:
2013-08-10T01:29:15.827320+00:00 app[web.1]: /app/config.ru:1:in `require': cannot load such file -- ./app (LoadError)
2013-08-10T01:29:15.827320+00:00 app[web.1]: from /app/config.ru:1:in `block in <main>'
该应用正在尝试加载您的 app.rb
文件,但它不存在。您的应用程序在本地运行的事实表明该文件尚未添加到 git。添加此文件(以及您的应用使用的任何其他文件),提交,然后再次推送:
$ git add app.rb
$ git commit
$ git push heroku master
关于ruby - Sinatra 应用程序未部署到 Heroku,rackup 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18157885/
您在 Sinatra 应用程序中使用什么验证码? 我喜欢 Google 的 http://www.google.com/recaptcha ,但似乎不适用于 Sinatra(不过有一个 Rails 插
如何从命令行将 Sinatra 应用作为守护程序运行? 它正在使用瘦: ruby app.rb -p 3000 -e production 我不喜欢在 app.rb 本身中设置它。我想从命令行取消它。
我正在使用 Sinatra 在 Ruby 中编写一个小型 Web 服务。使用 http 基本身份验证(在生产中通过 https)控制对几乎所有内容的访问。 我想从要求授权中排除一个特定的目录。是否有捷
我曾经能够在启动 sinatra 应用程序的窗口中看到为 sinatra 发出的 http 请求。 我认为在 sinatra 升级后我再也看不到它们了,我不知道如何做到这一点。我不需要将它们记录到文件
带有 activerecord gem 的 Sinatra 项目发出警告: DEPRECATION WARNING: Currently, Active Record suppresses error
我正在玩 Sinatra,我想让我的一条路线不区分大小写。我尝试添加这样的路线: get "(?i)/tileflood/?" do end 但它与预期的/tileflood 的任何排列都不匹配。我在
如果我没有在 Sinatra 中明确设置 session 过期时间,那么默认的过期时间是多少? 最佳答案 Sinatra session 来自 Rack::Session;所以开箱即用它默认为不过期。
似乎没有关于如何使用 Sinatra 中的 Rack::Protection 为表单启用 CSRF 保护的文档。有人做过这个吗?我似乎不知道如何告诉 Sinatra 启用此功能。 最佳答案 Sinat
假设我有一条 Sinatra 路线: put '/data' do request.body.read # ... end 看起来整个 request.body 都被读入内存了。有没有办法在主
我正在 Sinatra 中运行一个经典风格的应用程序,我想获取该应用程序绑定(bind)到的 URL。例如,如果我在开发环境中启动它,我希望得到:http://localhost:4567/,而在生产
我正在尝试在我的 Mac 上安装以下 ruby gem: http://www.sinatrarb.com/intro.html 我收到以下消息: michael-rosarios-mac
我最近更新到了 Ruby 1.9.2 (RVM)、Sinatra 1.1 和 Passenger 3.0.0。我有一个简单的应用程序,由以下部分组成: # config.ru require 'rub
似乎没有关于如何使用 Sinatra 中的 Rack::Protection 为表单启用 CSRF 保护的文档。有人做过这个吗?我似乎不知道如何告诉 Sinatra 启用此功能。 最佳答案 Sinat
与 sinatra 应用程序相比,Rack 应用程序有哪些优势? 谢谢 最佳答案 我认为提问者想要将它保留在 Rack 上的优点。 考虑到 Sinatra 已经是典型 Web 应用程序的极薄和简约的贴
我最近创建了一个带有登录表单(无基本身份验证)的 Sinatra 应用程序。为了防止在用户登录之前访问该应用程序,我在适当的位置放置了一个 before block before do unles
我如何设置 Sinatra 以便公用文件夹中的静态文件与响应 Access-Control-Allow-Origin = "*"一起返回? 最佳答案 在这里查看这个问题:Sinatra OPTIONS
我有一个基于 Sinatra 的 REST 服务应用程序,我想从其中一个路由中调用其中一个资源,从而有效地将一个资源与另一个资源组合在一起。例如 get '/someresource' do ot
我有一个使用经典 Sinatra 的旧项目(不是模块化 我在互联网上能找到的唯一使用 Puma 的示例是使用模块化 Sinatra。 引用:http://www.sinatrarb.com/intro
问题是默认处理程序是在 中定义的。 Sinatra::ShowExceptions ,由 控制:raise_errors 配置设置,这个设置是全有或全无。如果 :raise_errors 关闭然后 错
我有以下 Sinatra 应用程序,我正在测试 error阻止但它似乎不起作用。 这是我的 sinatra 应用程序: require 'rubygems' require 'sinatra' err
我是一名优秀的程序员,十分优秀!