I am able to run my sinatra web app locally just fine, but when I deploy it on Render, I am getting the following error:
Oct 23 11:45:58 PM from app.rb:1:in <main>' Oct 23 11:46:18 PM ==> Starting service with 'ruby app.rb' Oct 23 11:46:20 PM <internal:/opt/render/project/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in
require’: cannot load such file – sinatra (LoadError)
For context, here’s the top of my app.rb file, where the error is raised:
require 'sinatra'
And here’s what my Gemfile looks like:
source "https://rubygems.org"
ruby "3.0.0"
gem "sinatra"
gem "sinatra-contrib"
gem "erubis"
gem "rack-test"
gem "minitest"
gem 'webrick'
My best guess is that even though ‘bundle install’ downloads Sinatra during the build phase, Render’s version manager isn’t looking in the right place for it when my app.rb file requires Sinatra. Am I on the right track here? Is there a way to troubleshoot this issue with my free Render account?
Thank you in advance!