Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/64.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 引导响应中断_Ruby On Rails_Twitter Bootstrap - Fatal编程技术网

Ruby on rails 引导响应中断

Ruby on rails 引导响应中断,ruby-on-rails,twitter-bootstrap,Ruby On Rails,Twitter Bootstrap,克隆我的git repo后,我的应用程序坏了。我修复了它(删除了bootstrap_和_overrides.css.less),现在我可以真正看到页面,但是下拉列表和选项卡被破坏了。这让我觉得,出于某种原因,引导程序没有被加载。以下是我认为的罪魁祸首 Gemfile gem 'rails', '~> 3.2.6' gem 'bootstrap-sass', '~> 2.0.4.0' gem 'less', '~> 2.2.0' application.js //= requi

克隆我的git repo后,我的应用程序坏了。我修复了它(删除了bootstrap_和_overrides.css.less),现在我可以真正看到页面,但是下拉列表和选项卡被破坏了。这让我觉得,出于某种原因,引导程序没有被加载。以下是我认为的罪魁祸首

Gemfile

gem 'rails', '~> 3.2.6'
gem 'bootstrap-sass', '~> 2.0.4.0'
gem 'less', '~> 2.2.0'
application.js

//= require bootstrap
//= require_tree .
//= require jquery_ujs
//= require jquery-ui
$iconSpritePath: image-path('/glyphicons-halflings.png'); 
$iconWhiteSpritePath: image-path('glyphicons-halflings-white.png'); 
$navbarBackground: #555; 
$navbarBackgroundHighlight: #888; 
$navbarText: #eee; 
$navbarLinkColor: #eee; 

@import "bootstrap"; 
body { padding-top: 60px; } 
@import "bootstrap-responsive";
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require bootstrap
//= require_tree .
引导和覆盖.css.scss

//= require bootstrap
//= require_tree .
//= require jquery_ujs
//= require jquery-ui
$iconSpritePath: image-path('/glyphicons-halflings.png'); 
$iconWhiteSpritePath: image-path('glyphicons-halflings-white.png'); 
$navbarBackground: #555; 
$navbarBackgroundHighlight: #888; 
$navbarText: #eee; 
$navbarLinkColor: #eee; 

@import "bootstrap"; 
body { padding-top: 60px; } 
@import "bootstrap-responsive";
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require bootstrap
//= require_tree .

Eek,请帮忙?

卸载旧的gem
'bootstrap-sass','~>2.0.4.0'
并安装新版本的gem
bootstrap-sass',“~>2.2.0”

如果应用程序的某个部分损坏,则必须更改
引导和覆盖上的css代码。css
类似于:

// Set the correct sprite paths
$iconSpritePath: asset-url('glyphicons-halflings.png', image);
$iconWhiteSpritePath: asset-url("glyphicons-halflings-white.png", image);

@import "bootstrap";

/* new design.................................................................................*/

如果您以前自定义了此文件,那么您已经从
bootstrap\u和\u overrides.css
file

恢复了每个错误。我想您已经看到了引导javascript组件工作不正常

这是因为bootstrap的js组件依赖于jQuery,这些组件是在bootstrap之后而不是之前包含的。更改包含顺序(包括jquery):

application.js

//= require bootstrap
//= require_tree .
//= require jquery_ujs
//= require jquery-ui
$iconSpritePath: image-path('/glyphicons-halflings.png'); 
$iconWhiteSpritePath: image-path('glyphicons-halflings-white.png'); 
$navbarBackground: #555; 
$navbarBackgroundHighlight: #888; 
$navbarText: #eee; 
$navbarLinkColor: #eee; 

@import "bootstrap"; 
body { padding-top: 60px; } 
@import "bootstrap-responsive";
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require bootstrap
//= require_tree .

我终于找到了答案,如果有人遇到这个问题,希望它会有所帮助。发生的事情是,我包含了bootstrap-responsive.css,它被加载了两次。它已经包含在我的bootstrap_和_overrides.css.scss文件中。我删除了不需要的额外css文件,它可以正常工作。

我更新了gems。改变了精灵的路径。还是不行。恢复每个错误是什么意思?没有真正的错误,只是破坏了功能。[/link]是损坏的。你的意思是你的应用程序没有加载引导gem吗?。我的意思是,你可以在你的应用程序上看到一些css或javascript的twitter引导?是的,我可以看到css和javascript正在工作。这只是特别的引导响应的东西,如标签导航和引导折叠与@bdares解决方案!这个答案帮助我解决了我的问题!!谢谢你还没有得到任何绿色?如果我在jquery之后移动require_树,我的javascript就坏了。在引导之后,问题仍然存在。例如/some/page我点击我的可折叠文件,上面写着/some/page/#collapsableOne,但什么都没有展开这只是个愚蠢的问题吗?我还不够清楚吗?有人能帮我吗?