Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何在轨道引擎4.1.5中安装基础 看起来,基金会似乎并没有很好地使用Rails引擎。我正在设计一个样式布局引擎,这样我就可以将这个引擎插入到各种后端应用程序中。我喜欢使用基金会来做设计工作,但是不管我尝试什么样的安装技术,我仍然会遇到同样的错误:_Ruby On Rails_Gem_Zurb Foundation - Fatal编程技术网

Ruby on rails 如何在轨道引擎4.1.5中安装基础 看起来,基金会似乎并没有很好地使用Rails引擎。我正在设计一个样式布局引擎,这样我就可以将这个引擎插入到各种后端应用程序中。我喜欢使用基金会来做设计工作,但是不管我尝试什么样的安装技术,我仍然会遇到同样的错误:

Ruby on rails 如何在轨道引擎4.1.5中安装基础 看起来,基金会似乎并没有很好地使用Rails引擎。我正在设计一个样式布局引擎,这样我就可以将这个引擎插入到各种后端应用程序中。我喜欢使用基金会来做设计工作,但是不管我尝试什么样的安装技术,我仍然会遇到同样的错误:,ruby-on-rails,gem,zurb-foundation,Ruby On Rails,Gem,Zurb Foundation,我最初试着跑步: $rails g foundation:install 它返回: "could not find generator foundation:install" 我仔细检查了我的包,因为我将zurb foundation添加到了我的gemspec文件中。它在我的捆绑包中,所以我认为使用rails引擎而不是普通的rails应用程序是一个兼容性问题。我找到了这篇文章: 我试着听从@ivansnek的指示。这让我在chrome控制台中出现以下错误: foundation.js?b

我最初试着跑步:

$rails g foundation:install 
它返回:

"could not find generator foundation:install" 
我仔细检查了我的包,因为我将zurb foundation添加到了我的gemspec文件中。它在我的捆绑包中,所以我认为使用rails引擎而不是普通的rails应用程序是一个兼容性问题。我找到了这篇文章:

我试着听从@ivansnek的指示。这让我在chrome控制台中出现以下错误:

foundation.js?body=1:26 Uncaught TypeError
foundation.alerts.js?body=1:58 Uncaught ReferenceError: Foundation is not defined
foundation.clearing.js?body=1:517 Uncaught ReferenceError: Foundation is not defined
foundation.cookie.js?body=1:75 Uncaught ReferenceError: Foundation is not defined
foundation.dropdown.js?body=1:184 Uncaught ReferenceError: Foundation is not defined
foundation.forms.js?body=1:556 Uncaught ReferenceError: Foundation is not defined
foundation.joyride.js?body=1:853 Uncaught ReferenceError: Foundation is not defined
foundation.magellan.js?body=1:137 Uncaught ReferenceError: Foundation is not defined
foundation.orbit.js?body=1:432 Uncaught ReferenceError: Foundation is not defined
foundation.reveal.js?body=1:354 Uncaught ReferenceError: Foundation is not defined
foundation.section.js?body=1:431 Uncaught ReferenceError: Foundation is not defined
foundation.tooltips.js?body=1:210 Uncaught ReferenceError: Foundation is not defined
foundation.topbar.js?body=1:371 Uncaught ReferenceError: Foundation is not defined
foundation.interchange.js?body=1:281 Uncaught ReferenceError: Foundation is not defined
foundation.abide.js?body=1:195 Uncaught ReferenceError: Foundation is not defined
application.js?body=1:15 Uncaught ReferenceError: $ is not defined
然后,我在这里尝试了有关foundation文档的常规ol手册安装指南: 这给了我上面列出的同样的错误。有没有人碰到这些问题,可以告诉我正确的文档的方向,或者向我解释一下你是如何成功地把基础安装到Rails引擎的?作为结束说明,基金会似乎在我的虚拟应用程序中工作得很好。它只是在我的实际引擎里,我不能让它玩得很好。在我的虚拟应用程序中,我成功地运行了基础安装生成器。我的实际引擎需要手动安装,而不是rails生成器

编辑:

我添加了gem'foundationrails'。现在我的引擎中包含了zurb基础gem和基础rails gem。这消除了我遇到的“未捕获的引用错误”。但是现在对jQuery的引用不起作用。我的google控制台错误是“jQuery未定义”。这让我相信手动安装仍然不顺利。我在我的申请中引用基金会。JS喜欢:

//= require foundation
$(document).foundation();

确保在
GEM文件中有以下行:

gem 'zurb-foundation'
之后,您必须运行
bundle
命令。然后再试一次

rails g foundation:install

首先-摆脱zurb基金会。它已经死了(上一次发布是2013),在GEM中有两个不同版本的基金会会引起头痛。 我最近在一个普通的rails应用程序中遇到了这个问题。这似乎是由于一个bug,即在foundation/foundation(核心)之前需要插件,但尚未发布

您可以使用github的主分支:

gem 'foundation-rails', github: "zurb/foundation-rails"
或者在链轮清单中的“基础”之前要求“基础/基础”:

//= require 'jquery'
//= require 'foundation/foundation' 
//= require 'foundation'

存在一个已知问题,即基础导轨无法正确安装到可安装在导轨上的发动机中。我目前正在提交一个请求,并将在解决方案出现后更新此答案

如果您回到我的问题详细信息:我最初尝试运行:$railsgoundation:install,它返回:“找不到生成器foundation:install”我仔细检查了我的包,因为我将zurb foundation添加到了我的gempec文件中。它在我的包里,成功地。但是生成器仍然无法工作。“$未定义”->您的application.js中是否有您应该使用的jQuery?对于出现的问题以及您希望实现的目标,我有点困惑。您的最终用户是否打算添加gem,然后运行
foundation:install
生成器?或者你的应用程序有一个发电机,它又调用基础生成器?我的引擎的安装生成器将调用基础生成器。我试图实现的是创建一个带有前端的模板引擎,我可以将其插入各种应用程序中。然而,Foundation-Rails仍然不能很好地与Rails引擎配合使用。我认为您的答案是正确的,因为foundation rails是合适的宝石。但是,我们需要一个版本,该版本将有一个与名称空间一起工作的安装生成器。