Skip to content

Rails 8.0 workaround (may be useful until full support in gem) #136

@pr0d1r2

Description

@pr0d1r2

Please note that usage of gem in Rails 8.0.0 is possible but with workaround:

Gemfile

gem "pry-rails", require: false

config/initializers/pry.rb

if %w[development test].include?(Rails.env)
  # NOTE: this got deprecated in Rails 8.0 but is still used in pry-rails which is barely maintained gem.
  require "rails/console/app"

  require "pry-rails"
end

lib/rails/console/app.rb (straight copy from rails 7.2 with extension):

Rails.deprecator.warn(<<~MSG, caller_locations(0..1))
`rails/console/app` has been removed in Rails 8.0.
Please require `rails/console/methods` instead.
NOTE: this is XXX project implant to support deprecated gem.
MSG

require "rails/console/methods"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions