我可以在heroku上部署我的基本sinatra应用程序,但运行它会出现“APP CRASHES”错误
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.
答案 0 :(得分:6)
创建一个名为“.gems”的文件,并包含此行“sinatra”。
通过这种方式你指示包括sinatra gem更多信息请点击此处:http://docs.heroku.com/rack#sinatra