trilogy-libraries / activerecord-trilogy-adapter

Active Record adapter for the Trilogy database client for Rails v6.0 - v7.0.
https://github.com/trilogy-libraries/trilogy
MIT License
171 stars 17 forks source link

Rails 7.1 application generating a missing gem error #73

Open josephmo opened 4 months ago

josephmo commented 4 months ago

I generated a new Rails 7.1 application, and made sure the Mysql gem was removed from the Gemfile. I did not include the Trilogy gem, as your docs said that the Trilogy adapter is included in Rails 7.1

Then I did:

rails generate model Book name:string email:string And the response was:

/Users/joseph-mac/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/bundler/rubygems_integration.rb:280:in `block (2 levels) in replace_gem': 
Error loading the 'trilogy' Active Record adapter. Missing a gem it depends on? 
trilogy is not part of the bundle. Add it to your Gemfile. (LoadError)
from /Users/joseph-mac/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/activerecord-7.1.3.3/lib/active_record/connection_adapters/trilogy_adapter.rb:5:in `<main>'

My database.yml file:

default: &default
  adapter: trilogy
  encoding: utf8mb4
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  username: root
  password:
  socket: /tmp/mysql.sock
iggant commented 2 months ago

@josephmo you have to include trilogy gem to your Gemfile. Because only trilogy_adapter is included to the Rails