1

After installing the Ahoy Gem and adding
ahoy.trackAll(); to my application.js, my application is continually redirected to /undefined. I've tried uninstalling and recreating the database, but no luck.

Here's the server log.

SQL (0.3ms)  INSERT INTO `ahoy_events` (`id`, `visit_id`, `name`, `properties`, `time`) VALUES (x'438ffd6f7d4c4291876441fa2b5dcdf0', x'61671132b25b4f169a54ece65dc524b3', '$view', '{\"url\":\"http://localhost:3000/\",\"title\":\"Title\",\"page\":\"/\"}', '2015-08-10 20:12:57')
   (30.7ms)  COMMIT
Completed 200 OK in 161ms (Views: 0.2ms | ActiveRecord: 68.8ms)

Started GET "/undefined" for ::1 at 2015-08-10 16:12:59 -0400

ActionController::RoutingError (No route matches [GET] "/undefined"):
Jordan Running
  • 102,619
  • 17
  • 182
  • 182
rockyroadster555
  • 313
  • 1
  • 4
  • 15
  • Have you run `rails generate ahoy:stores:active_record -d postgresql rake db:migrate`? Did you require `//= require ahoy` in `application.js`? – Chase Aug 10 '15 at 20:52
  • I ran the mysql equivalent of rails generate. I am requiring ahoy in js and I can access the Javascript methods – rockyroadster555 Aug 10 '15 at 21:01
  • Odd... Have you marked any models `visitable`, and have you tried setting `ahoy.track` in your Ruby instead of your js? – Chase Aug 10 '15 at 21:04

0 Answers0