sinatra-activerecord / sinatra-activerecord

Extends Sinatra with ActiveRecord helper methods and Rake tasks.
MIT License
734 stars 114 forks source link

LoadError: cannot load such file -- sinatra/activerecord/rake/activerecord_8 (LoadError) #134

Open thspower opened 2 weeks ago

thspower commented 2 weeks ago

Fresh install.

Error:

LoadError: cannot load such file -- sinatra/activerecord/rake/activerecord_8 (LoadError)  /home/vagrant/.rvm/gems/ruby-3.3.1/gems/sinatra-activerecord-2.0.27/lib/sinatra/activerecord/rake.rb:2:in `<top (required)>'
/home/app/rakefile:1:in `<top (required)>'

Gemfile

gem "sinatra-activerecord"
gem "sqlite3"
gem "rake"

Installation

Fetching gem metadata from https://rubygems.org/...........                                                                                
Resolving dependencies...                                                                                                                  
Fetching benchmark 0.4.0                                                                                                                   
Installing benchmark 0.4.0                                                                                                                 
Fetching concurrent-ruby 1.3.4                                                                                                             
Installing concurrent-ruby 1.3.4
Fetching i18n 1.14.6
Installing i18n 1.14.6
Fetching logger 1.6.1
Installing logger 1.6.1
Fetching minitest 5.25.1
Installing minitest 5.25.1
Fetching uri 1.0.0
Installing uri 1.0.0
Fetching activesupport 8.0.0
Installing activesupport 8.0.0
Fetching activemodel 8.0.0
Installing activemodel 8.0.0
Fetching timeout 0.4.2
Installing timeout 0.4.2
Fetching activerecord 8.0.0
Installing activerecord 8.0.0
Fetching sinatra-activerecord 2.0.27
Installing sinatra-activerecord 2.0.27
Fetching sqlite3 2.2.0 (x86_64-linux-gnu)
Installing sqlite3 2.2.0 (x86_64-linux-gnu)
Bundle complete! 10 Gemfile dependencies, 38 gems now installed.

Seems similar to this issue.

thspower commented 2 weeks ago

Solved for now by specifying activerecord, ~7 in Gemfile.

gem 'sinatra-activerecord'
gem 'activerecord', '~> 7'
peracchi commented 2 weeks ago

For me it is no longer working even using gem 'activerecord', '~> 7' on Gemfile. I also updated Ruby from version 3.3.5 to 3.3.6. But I think the problem started when I updated Rails and some associated gems from version 7.2 to 8.0. I'll try to do some tests in a VM or container to see if I can identify exactly what causes the problem and how to revert it.

peracchi commented 2 weeks ago

It seems that something in Ruby 3.3.6 or some other gem that comes with it is aggravating the problem. After reinstalling Ruby 3.3.5 and changing the Gemfile to

source "https://rubygems.org"

ruby '3.3.5'

gem 'sinatra'

gem 'activerecord', '~> 7.2'

gem 'sinatra-activerecord'

gem 'sqlite3'

gem 'rake'

it seems that the sinatra-activerecord gem and the rake db:something commands are working again.

peracchi commented 6 days ago

Any idea when sinatra-activerecord will work with Active Record 8?

Is the problem only with Active Record 8 or is there some other problem with Ruby 3.3.6?