I am currently facing a similar problem.
- I'm working on a Redmine plugin, mainly adding tests.
- Plugin location: plugins/toggl2redmine - it's detected correctly.
- I wish to use Pry for debugging while I write my tests.
- Here's what I've tried:
- Created a Gemfile in the root of my plugin and ran `bundle install` in Redmine root.
- Created a PluginGemfile in the root of my plugin and ran `bundle install` in Redmine root.
- Installed "pry" globally with "gem install pry"
None of the above seem to make "pry" available in my test. Nothing works, except when I add "pry" directly into "REDMINE/Gemfile".
I add some "puts" in that Gemfile and found that the `Dir.glob` block that tries to load the plugin gemfiles is actually detecting my plugin's Gemfile or PluginGemfile correctly, but just that pry is not installed even after "eval_gemfile". Am I missing something? Here's how my Gemfile looks:
# frozen_string_literal: true
source 'https://rubygems.org'
# I've also tried specifying a version, but the results are the same.
gem 'pry', group: [:development, :test]
I've also tried doing a `Bundler.require(*Rails.groups)` in my `test_helper.rb`. Nothing works :(
Update: It works!¶
Finally, I think I figured it out. Since the plugin Gemfile is included from within a main Gemfile, it does not need a "source". So, removing the "source" line fixes the problem.