找不到文件'dataTables/jquery.dataTables'Rails 4

Leo*_*eoJ 4 datatable jquery datatables ruby-on-rails-4 jquery-datatables

我正在跟踪rails#340以在我的应用程序中实现数据表.

按照所有步骤我得到这个错误:找不到文件'dataTables/jquery.dataTables'

我正在使用rails 4,我发现教程中提到的一些文件我必须创建像application.css和products.js.coffee

的Gemfile

gem 'jquery-rails'
group :assets do 
  gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails'
  gem 'jquery-ui-rails'
end
Run Code Online (Sandbox Code Playgroud)

的application.js

//= require jquery
//= require dataTables/jquery.dataTables
//= require_tree .
Run Code Online (Sandbox Code Playgroud)

Application.js.coffee

 /* 
 * This is a manifest file that'll automatically include all the stylesheets available in this directory 
 * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at 
 * the top of the compiled file, but it's generally better to create a new file per style scope. 
 *= require_self 
 *= require dataTables/jquery.dataTables 
 *= require_tree .  
*/  
Run Code Online (Sandbox Code Playgroud)

和rails 4一样,我在/layouts/application.html.erb中添加了对样式表的调用

<%= stylesheet_link_tag 'application.css', media: 'all' %>
Run Code Online (Sandbox Code Playgroud)

和products/index.htm.erb

<table class="table table-normal" id="products" >
  <thead>
    <tr>
                      <td>Code</td>
                      <td>Name</td>
                      <td>Description</td>
                      <td>Price</td>
                      <td>Stock</td>
                      <td>Enabled</td>
                      <td>Company</td>
              </tr>

  </thead>

  <tbody>   

    <% @products.each do |product| %>
      <tr>                          
            <td style="text-decoration: underline;"><%= link_to product.code, edit_product_path(product) %></td>             

            <td><%= product.name %></td>             

            <td><%= product.description %></td>              

            <td><%= product.price %></td>              

            <td><%= product.stock %></td>              

            <td><%= product.enabled %></td>              

            <td><%= product.company_id %></td>              

      </tr>
    <% end %>
  </tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

我在输出中出现此错误

找不到文件'dataTables/jquery.dataTables'(在.... app/assets/stylesheets/application.css:6中)

任何想法如何解决这个问题?提前致谢

Alm*_*ron 6

没有更多:Rails 4中的资产组,所以只需从该块中获取宝石.