I am running into an several errors saying, "Uncaught ReferenceError: Foundation is not defined". They happen into the following:
我遇到了几个错误,比如“未捕获的ReferenceError: Foundation未定义”。它们发生在下面:
- 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
.
在控制台,我键入Foundation,并得到:Object {name:“Foundation”,version:“5.5.1”,media_query: Object,样式表:CSSStyleSheet,全局:Object…}全局:Objectinherit:函数(范围、方法){init:函数(范围、库、方法、选项、响应){init_lib: function (lib, args) {libs: objectmedia_query: Objectname:“Foundation”补丁:function (lib) {rtl: falsescope: documentset_namespace: function () {font - size: function () {font - size: 10.5 pt; font - family:宋体;
I also verified that jQuery is working by using the console: $(document) resulting in [>#document].
我还通过使用控制台:$(document)来验证jQuery是否正常工作,结果是[>#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.
我正在Ruby上运行Rails(4.2.1)堆栈(2.0.0),并且一直在遵循zurb/ foundationrails的基本教程/演练。
rails g foundation:install
I have also tried RailsApps/rails_layout gem but am getting the same error.
我也尝试过RailsApps/rails_layout gem,但是我得到了相同的错误。
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.
我能想到的唯一一件事是在所有需要它的函数之后定义Foundation(遵守、手风琴导航等等),但是这不应该发生,因为框架代码来自模板生成器。我在RoR或Foundation结构方面没有经验,所以我想知道如何找到误差。
Or if this was just a client issue with my Mac.
或者如果这只是我的Mac的客户问题。
1 个解决方案
#1
5
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.
这是由基础-rails gem的5.5.1.1版本中的一个错误引起的。上面列出的插件是在基础代码本身之前加载的。
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:
5.5.1.2正在修复这个问题,但同时您可以通过回到以前的版本来解决这个问题:
gem 'foundation-rails', '= 5.5.1.0'
#1
5
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.
这是由基础-rails gem的5.5.1.1版本中的一个错误引起的。上面列出的插件是在基础代码本身之前加载的。
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:
5.5.1.2正在修复这个问题,但同时您可以通过回到以前的版本来解决这个问题:
gem 'foundation-rails', '= 5.5.1.0'