gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 14:38:30 25 4
gpt4 key购买 nike

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

运行“heroku 日志”会出现以下错误。我正在使用 ruby​​1.9.1。不知道为什么这个 ruby​​1.8.7 显示在回溯中。请帮忙

anmol@anmol-laptop:heroku$ heroku 日志
/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
要求'
来自 ./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
要求'
来自 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
初始化'
来自/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
初始化'
来自/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
实例评估'
来自/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
新的'
来自/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
要求'
来自 ./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
要求'
来自 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
初始化'
来自/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
初始化'
来自/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
实例评估'
来自/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
新的'
来自/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.

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

最佳答案

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

通过这种方式,您正在指示包含 sinatra gem

更多信息在这里:http://docs.heroku.com/rack#sinatra

关于heroku - 在heroku上部署sinatra应用程序时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4279708/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com