我正在嘗試使用rails和bootstrap-sass創建一個webapp。
我安裝了那些從Ruby On Rails With Bootstrap Tutorial (simple),它的工作指令。在紅寶石軌道上安裝bootstrap-sass後出現錯誤
安裝bootstrap-sass gem並嘗試在瀏覽器中打開我的應用程序後,ruby/rails會給我一個錯誤消息。
Showing C:/Sites/bopp/app/views/layouts/application.html.erb where line #7 raised: TypeError: Das Objekt unterstützt diese Eigenschaft oder Methode nicht.>
條目:
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
根據Ruby on Rails Application coult not include stylesheet nor js我改變了它,並得到了另一個錯誤:
Showing C:/Sites/bopp/app/views/layouts/application.html.erb where line #7 raised: The asset "default.css" is not present in the asset pipeline.
條目:
<%= stylesheet_link_tag "default", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "default", "data-turbolinks-track" => true %>
我改變application.css到APPLI cation.css.scss。 條目:
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
* vendor/assets/stylesheets directory can be referenced here using a relative path.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/
@import 'bootstrap-sprockets';
@import 'bootstrap';
只有一個變化的Gemfile:
gem 'bootstrap-sass'
我改變而已。然後我跑bundle install
。
紅寶石版本:2.3.3
Rails的版本:5.1.0(從http://railsinstaller.org/en下載)
操作系統:Windows 7
編輯:崇高文本2
瀏覽器:Mozilla Firefox瀏覽器
也許一些關於與第一條消息的詳細信息「對象不支持此屬性或方法」。也許文件的名稱應該是layouts/application.html.erb,特別是第7行? – Jake