2

When I enter reload! in my Rails console using pry-rails, it doesn't appear to be working; i.e., the changes I made to my code aren't implemented. Everything I've read seems to say that the pry-rails gem implements reload! all on its own.

Here's how I test it: (I put Deal.hello in my code between pry lines 1 & 2)

// ♥ rails c
Running via Spring preloader in process 66760
Loading development environment (Rails 5.2.2)
[1] pry(main)> Deal.hello                                                                                                                     
NoMethodError: undefined method `hello' for Deal (call 'Deal.connection' to establish a connection):Class
from /Users/TuzsNewMacBook/.rvm/gems/ruby-2.3.7/gems/activerecord-5.2.2/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
[2] pry(main)> Deal.hello                                                                                                                     
NoMethodError: undefined method `hello' for Deal (call 'Deal.connection' to establish a connection):Class
from /Users/TuzsNewMacBook/.rvm/gems/ruby-2.3.7/gems/activerecord-5.2.2/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
[3] pry(main)> reload!                                                                                                                        
Reloading...
=> true
[4] pry(main)> Deal.hello                                                                                                                     
NoMethodError: undefined method `hello' for Deal (call 'Deal.connection' to establish a connection):Class
from /Users/TuzsNewMacBook/.rvm/gems/ruby-2.3.7/gems/activerecord-5.2.2/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
[5] pry(main)> exit                                                                                                                           
[11:50:33] (deal-has-one-region) fares-you-can-use-rails
// ♥ rails c
Running via Spring preloader in process 66780
Loading development environment (Rails 5.2.2)
[1] pry(main)> Deal.hello                                                                                                                     
=> "hello"
[2] pry(main)>  
Jonathan Tuzman
  • 11,568
  • 18
  • 69
  • 129

0 Answers0