Skip to content

Instantly share code, notes, and snippets.

@mbuffa
Last active October 28, 2016 07:49
Show Gist options
  • Save mbuffa/6058b45da3d9c76f2bd627758e0ff1b6 to your computer and use it in GitHub Desktop.
Save mbuffa/6058b45da3d9c76f2bd627758e0ff1b6 to your computer and use it in GitHub Desktop.
# In app/services
puts 'oh hey!'
class SomeService
end
Loading development environment (Rails 4.1.15)
Frame number: 0/5
[1] pry(main)> Services::SomeService
oh hey!
=> SomeService
[2] pry(main)> Services::SomeService
NameError: uninitialized constant Services::SomeService
from (pry):2:in `<main>'
[3] pry(main)> reload!
Reloading...
=> true
[4] pry(main)> svc = Services::SomeService.new
oh hey!
=> #<SomeService:0x007fbc1d0f9430>
[5] pry(main)> Services::SomeService.new
NameError: uninitialized constant Services::SomeService
from (pry):5:in `<main>'
[6] pry(main)> SomeService.new
=> #<SomeService:0x007fbc1e2b0340>
[7] pry(main)>
@mhammiche
Copy link

I cannot reproduce this behavior.
Where the constant Services come from ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment