Error while connecting to local DB using Ruby ROM with Sinatra

I’m fairly new to Sinatra and trying to connect to my database and using Ruby ROM gem for this. However, I’m always getting the following error message when I’m trying to execute my rake task: ArgumentError: URIs without an explicit scheme are not supported anymore.

Here is my Rakefile:

require_relative './config/environment'
require 'rom/sql/rake_task'

namespace :db do
  task :setup do
    configuration = ROM::Configuration.new(:sql, ENV['DATABASE_URL'])
    ROM::SQL::RakeSupport.env = configuration
  end
end

And this my .env.development while where I’ve placed my database URL

DATABASE_URL='postgres://username:password@localhost/convertor_dev'

I’m using the following gems(if this helps):

  • rom
  • rom-sql
  • pg
  • rake

Are you sure your DATABASE_URL is properly set?