4

I would like to add binding.pry to check some things on fly in kaminari gem which is dependency of activeadmin gem. I use also kaminari as completely separate gem.

activeadmin (1.0.0.pre5)
      arbre (~> 1.0, >= 1.0.2)
      bourbon
      coffee-rails
      formtastic (~> 3.1)
      formtastic_i18n
      inherited_resources (~> 1.6)
      jquery-rails
      jquery-ui-rails
      kaminari (~> 0.16.1)
      railties (>= 3.2, < 5.1)
      ransack (~> 1.3)
      sass-rails
      sprockets (< 4.1)

I've already tried something like below in Gemfile:

gem 'kaminari', git: 'https://github.com/hubertjakubiak/kaminari.git', branch: 'v0.16.3'

1 Answer 1

18

No need for forking here. You can edit locally installed gems. Just do this:

bundle open kaminari

It will open the corresponding version of kaminari in your $EDITOR. There you can insert debug printing, binding.pry or whatever you like. Don't forget to restart the app/server.

And don't forget to clean up when you're done. Either by manually undoing your changes or running

bundle pristine kaminari
Sign up to request clarification or add additional context in comments.

3 Comments

.. and don't forget to remove it afterwards, so you don't get a surprise interruption when using the gem again months later
@matthewd: yeah, this may have happened to me :)
Don't forget to restart the app/server. - Critical !! NB - Many a time edited gem files, and wondered why nothing was happening.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.