awesome-print / awesome_print

Pretty print your Ruby objects with style -- in full color and with proper indentation
http://github.com/michaeldv/awesome_print
MIT License
4.07k stars 454 forks source link

Bugfix / Use rails 5.0 compatible sqlite #369

Closed paulodiovani closed 2 weeks ago

paulodiovani commented 4 years ago

Changes in this PR

SQlite3 version compat with Rails 5.0

New sqlite3 version arrived in February 2019 but Rails 5.0 (actually sqlite3_adapter) was expecting ~> 1.3.6

This leads to failed builds with the following error:

>> BUNDLE_GEMFILE=/home/diovani/Development/Ruby/awesome_print/gemfiles/rails_5.0.gemfile bundle exec rake             

An error occurred while loading ./spec/ext/active_record_spec.rb.                                                      
Failure/Error: ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'                                                                                                                                                

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).
# ./spec/active_record_helper.rb:10:in `<top (required)>'                                                                                                                                                                                      
# ./spec/ext/active_record_spec.rb:2:in `require'                                                                                                                                                                                              
# ./spec/ext/active_record_spec.rb:2:in `<top (required)>'                                                                                                                                                                                     
# ------------------                                                                                                   
# --- Caused by: ---                                                                                                                                                                                                                           
# Gem::LoadError:                                                                                                                                                                                                                              
#   can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.1. Make sure all dependencies are added to Gemfile.                                                                                                                       
#   ./spec/active_record_helper.rb:10:in `<top (required)>'                                                            
Run options: include {:focus=>true}                                                                                                                                                                                                            

All examples were filtered out; ignoring {:focus=>true}                                                                                                                                                                                        

Finished in 0.00016 seconds (files took 0.49679 seconds to load)                                                                                                                                                                               
0 examples, 0 failures, 1 error occurred outside of examples                                                                                                                                                                                   

This PR sets to use sqlite3 ~> 1.3.6, which works with Rails 5.0. I don't think we need a specific sqlite3 version for the tests, so this is the easiest fix.

paulodiovani commented 4 years ago

ruby-head tests are failing. It seems to be due to some low-level changes in ruby internals in v2.7. I see we have option to ignore failures. Can I enable these lines (https://github.com/paulodiovani/awesome_print/blob/bug/fix-sqlite/.travis.yml#L28-L29) and let 2.7.0 to be fixed in another PR?

gklsan commented 4 years ago

LGTM +1

paulodiovani commented 2 weeks ago

Approved but never merged by maintainers. Closing.