I am on WSL, working on Ruby on Sinatra web application training, when I require the './main' on heroku run console command, I get LoadError and it can't require 'dm-postgres-adapter.
I have been following a tutorial, using WSL, I installed Ruby along with its dependencies, so far all the gems I've installed were successful. But when I push to heroku and when I run the 'heroku run console' command, and I type in 'require "./main"' I get a LoadError, telling me...
joelg@SurfacePro3:~/RubyProgs/SinatraExcercise$ heroku run console
Running console on ⬢ sinatra-project-jg... up, run.2550 (Free)
irb(main):001:0> require './main'
WARNING: If you plan to load any of ActiveSupport's core extensions to Hash, be sure to do so *before* loading Sinatra::Application or Sinatra::Base. If not, you may disregard this warning. LoadError: cannot load such file -- dm-postgres-adapter from /app/vendor/bundle/ruby/2.4.0/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:163:in `require' from /app/vendor/bundle/ruby/2.4.0/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:163:in `load_adapter' from /app/vendor/bundle/ruby/2.4.0/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:133:in `adapter_class' from /app/vendor/bundle/ruby/2.4.0/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:13:in `new' from /app/vendor/bundle/ruby/2.4.0/gems/dm-core-1.2.1/lib/dm-core.rb:230:in `setup' from /app/main.rb:21:in `block in ' from /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.4/lib/sinatra/base.rb:1426:in `configure' from /app/vendor/bundle/ruby/2.4.0/gems/sinatra-2.0.4/lib/sinatra/base.rb:1925:in `block (2 levels) in delegate' from /app/main.rb:20:in `' from (irb):1:in `require' from (irb):1 from /app/bin/irb:15:in `' irb(main):002:0>
When I ran it said that dm-postgres-adapter is not required, but it is I have it loaded on my Gemfile.
I was getting the same errors. Don't ignore the Warnings from Heroku when you push to heroku.
If you're using Git (which you probably are) you'll need to first remove the .bundle/ folder via the command line:
git rm --cached -r .bundle/
Then you'll need to add a .gitignore file in the main directory with ".bundle/" in the body of the file
Commit it all to git and/or github. Push to Heroku. (no more nasty warning RE the .bundle/ folder)
Then run your heroku run console command and pick up with the Jumpstart tutorial again.