kaminari / kaminari-sinatra

Kaminari Sinatra adapter
MIT License
27 stars 10 forks source link

Including kaminari-sinatra attempts to read translation files from padrino gem #7

Open maca opened 6 years ago

maca commented 6 years ago

I am not using padrino in my new Sinatra app. But including kaminari-sinatra attempts somehow to read translation files from padrino.

Is the padrino-helpers depencency necesary?

This is when I run my previously passing specs after adding kaminari-sinatra into my gemfile.

3) Admin voucher management vouchers listing authenticated admin visits it paginates vouchers navigate to the next page behaves like lists n vouchers lists 5 vouchers
    Failure/Error: name { Faker::Name.name }                                                           

     I18n::InvalidLocaleData:                                                                        
       can not load translations from /usr/lib/ruby/gems/2.5.0/gems/padrino-core-0.9.21/lib/padrino-core/locale/cz.yml: #<Psych::SyntaxError: (/usr/lib/ruby/gems/2.5.0/gems/padrino-core-0.9.21/lib/padrino-core/locale/cz.yml): did not find 
expected node content while parsing a flow node at line 15 column 13>                                        
     Shared Example Group: "lists n vouchers" called from ./spec/features/admin/voucher_management_spec.rb:39
yuki24 commented 6 years ago

It's always nice to drop dependencies. Sinatra is very minimal and doesn't implement methods that Kaminari depends on. I was not part of the team when the padrino-helpers gem was added in the first place, but my hunch is that some dependencies were added just to get things out the door. It would be greatly appreciated if you could contribute back to the community.

maca commented 6 years ago

@yuki24 thanks for your reply, I couldn't get to get kaminari-sinatra working with my app, I still don't know if it has to do with my use of faker which injects i18n gem. I will look further and see if I could find the time to attempt to replace the padrino-helpers methods.

yuki24 commented 6 years ago

padrino-core-0.9.21 looks quite old. I wonder if that should be a more recent version, possibly the latest version otherwise some compatibility issue may arise.

caiodsc commented 5 years ago

Steps to resolve:

gem install padrino-core gem install padrino-helpers Go to kaminari-sinatra gem folder Find the folder called "Gemfiles" There are some .gemfile files Change gem 'padrino-helpers' ~> 0.12.0 for gem 'padrino-helpers'

End