在heroku上部署sinatra应用程序时出现问题

时间:2010-11-25 17:48:34

标签: heroku

我可以在heroku上部署我的基本sinatra应用程序,但运行它会出现“APP CRASHES”错误

运行“heroku logs”会出现以下错误。我使用的是ruby1.9.1。不知道为什么这个ruby1.8.7在回溯中显示。请帮助

anmol @ anmol-laptop:heroku $ heroku logs /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- sinatra (LoadError) from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require'  来自./main.rb:2  来自/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require'  来自config.ru:1  来自/home/heroku_rack/heroku.ru:23  来自/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in instance_eval' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in initialize'  来自/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:46:in new' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:46:in map'  来自/home/heroku_rack/heroku.ru:18  来自/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in instance_eval' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in initialize'  来自/home/heroku_rack/heroku.ru:11:in new' from /home/heroku_rack/heroku.ru:11 from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in instance_eval'  来自/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in initialize' from /home/heroku_rack/heroku.ru:1:in new'  来自/home/heroku_rack/heroku.ru:1

==> dyno-3277552.log(崩溃)< == /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- sinatra (LoadError) from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require'  来自./main.rb:2  来自/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require'  来自config.ru:1  来自/home/heroku_rack/heroku.ru:23  来自/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in instance_eval' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in initialize'  来自/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:46:in new' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:46:in map'  来自/home/heroku_rack/heroku.ru:18  来自/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in instance_eval' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in initialize'  来自/home/heroku_rack/heroku.ru:11:in new' from /home/heroku_rack/heroku.ru:11 from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in instance_eval'  来自/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in initialize' from /home/heroku_rack/heroku.ru:1:in new'  来自/home/heroku_rack/heroku.ru:1

- - - - >您的应用程序需要一个找不到的文件。

   Most often this is due to missing gems, or it could be that you failed
   to commit the file to your repo.  See http://docs.heroku.com/gems for
   more information on managing gems.

检查此消息上方的回溯以进行调试。

1 个答案:

答案 0 :(得分:6)

创建一个名为“.gems”的文件,并包含此行“sinatra”。

通过这种方式你指示包括sinatra gem

更多信息请点击此处:http://docs.heroku.com/rack#sinatra