Closed debaillie closed 6 years ago
The uninitialized constant error is because you need to require "pusher-fake"
. When running bundle exec irb
it's not actually loading anything from your Gemfile
. If you have the dependency in the test group, then it also won't work if you run bundle exec rails console
unless you run RAILS_ENV=test bundle exec rails console
.
Perhaps I should add require "pusher-fake"
to the base support file, instead of assuming it's being loaded elsewhere. Not sure, since that could also be confusing in some cases.
That being said, it seems like you should be seeing the same error when running the server. Can you provide the group and line for pusher-fake
in your Gemfile
?
You are correct.
I fixed the problem by putting require 'pusher-fake'
before the require 'pusher-fake/support/base'
Additionally I had to escape the html in the application:
var pusher = <%= PusherFake.javascript.html_safe %>;
@debaillie Awesome. Let me know if I can help out with anything else.
FYI added a warning for this case: https://github.com/tristandunn/pusher-fake/commit/29d2e4c7aabd93395c41dd99129330c725ac8177
I'm doing something wrong here... hopefully something simple. I'm try to run the pusher-fake in development with the
rails s
command. I'm running rails 4.2.9 with pusher-fake 1.8.0 and pusher 0.18.0.In my config/environments/development.rb, I have:
In my application code I have:
When I start the server with
rails s
, I get:Notice there is no mention of the pusher-fake running.
When I try to run it in irb (bundle exec irb), then:
I get this error:
What am I missing?