diff --git a/lib/guard/jobs/pry_wrapper.rb b/lib/guard/jobs/pry_wrapper.rb index ea48ebd61..a6eb9397c 100644 --- a/lib/guard/jobs/pry_wrapper.rb +++ b/lib/guard/jobs/pry_wrapper.rb @@ -134,7 +134,12 @@ def _setup(options) Pry.config.should_load_rc = false Pry.config.should_load_local_rc = false history_file_path = options[:history_file] || HISTORY_FILE - Pry.config.history.file = File.expand_path(history_file_path) + + if Pry.config.respond_to?(:history_file) + Pry.config.history_file = File.expand_path(history_file_path) + else + Pry.config.history.file = File.expand_path(history_file_path) + end _add_hooks(options)