Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pry-rails not rails console working with Rails 4.0

included 'pry-rails' in my Gemfile run console and get the following

@marketplace-rails/gems/pry-rails-0.2.0/lib/pry-rails/commands.rb:3:in `block in <module:PryRails>': undefined method `create_command' for #<Pry::CommandSet:0x007fcfaa67a878> (NoMethodError)
like image 976
Stephen Nguyen Avatar asked Oct 03 '13 05:10

Stephen Nguyen


3 Answers

  • Step 1. don't use 'pry-rails' ? (not sure how to get that gem working)
  • Step 2. in gemfile include gem 'pry'
  • Step 3. in application.rb include the following...
console do
  require "pry"
  config.console = Pry
end

run rails console be happy to have pry back in your life.

like image 156
Stephen Nguyen Avatar answered Nov 04 '22 17:11

Stephen Nguyen


For what it's worth, I just tried this:

group :development, :test do
  gem 'pry-rails'
end

Followed by a bundle install and a 'rails c' and pry came up.

like image 7
Trevoke Avatar answered Nov 04 '22 17:11

Trevoke


Try stopping spring,

$ bin/spring stop

worked for me after installing the gem, didn't even have to change it in the config/environment/development file either

like image 3
cam_271 Avatar answered Nov 04 '22 18:11

cam_271