I am running into an several errors saying, "Uncaught ReferenceError: Foundation is not defined". They happen into the following:
- foundation.abide
- foundation.accordion
- foundation.clearing
- foundation.dropdown
- foundation.equalizer
- foundation.interchange
- foundation.joyride
In console, I typed Foundation, and got: Object {name: "Foundation", version: "5.5.1", media_queries: Object, stylesheet: CSSStyleSheet, global: Object…}global: Objectinherit: function (scope, methods) {init: function (scope, libraries, method, options, response) {init_lib: function (lib, args) {libs: Objectmedia_queries: Objectname: "Foundation"patch: function (lib) {rtl: falsescope: documentset_namespace: function () {stylesheet: CSSStyleSheetutils: Objectversion: "5.5.1"__proto__: Object
.
I also verified that jQuery is working by using the console: $(document) resulting in [>#document].
I am running a Rails (4.2.1) stack on Ruby (2.0.0), and have been following the basic tutorial/walkthrough on zurb/foundation-rails.
rails g foundation:install
I have also tried RailsApps/rails_layout gem but am getting the same error.
rails generate layout:install foundation5 --force
The only thing I can think of is that I am defining Foundation after all the functions that needed it (abide, accordion, etc) but that shouldn't happen because the skeleton code is from the template generators. I'm not experienced in RoR or in the structure of Foundation to know if that's the case, so I was wondering where I can go about finding the error to this.
Or if this was just a client issue with my Mac.
This is caused by a bug in the 5.5.1.1 release of the foundation-rails
gem. The plugins you listed above are loaded before the foundation code itself.
5.5.1.2 is on the way to fix this, but in the meantime you can resolve the issue by going back to the previous version:
gem 'foundation-rails', '= 5.5.1.0'