Gem::LoadError Sqlite3

#1

Hi,

I opened a new rails project and when I try to test it on the server I get :

Gem::LoadError
Specified ‘sqlite3’ for database adapter, but the gem is not loaded. Add gem 'sqlite3' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

Here is the code:
require path_to_adapter
rescue Gem::LoadError => e
raise Gem::LoadError, “Specified ‘#{spec[:adapter]}’ for database adapter, but the gem is not loaded. Add gem '#{e.name}' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).”
rescue LoadError => e
raise LoadError, “Could not load ‘#{path_to_adapter}’. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than ‘mysql2’, ‘postgresql’ or ‘sqlite3’ add the necessary adapter gem to the Gemfile.”, e.backtrace
end

I have checked the gemfile and it does have sqlite3 already. I’ve tried the same fix I used on my local environment by doing rails new project_name --skip-bundle, then modifying the gemfile for sqlite3 and then running bundle install, but that didn’t work either. I can run exactly the same file on my local machine, but it won’t work here or at AWS.

Shouldn’t the IDE work out of the box for rails?

I have exactly the same problem when using Cloud 9 at AWS.

0 Likes