【发布时间】:2014-06-07 11:00:41
【问题描述】:
我正在尝试使用一些滑块宝石,但我一直遇到同样的问题,
https://github.com/soycamo/jquery-nouislider-rails
我按照说明放入 app/assets/javascript 清单文件:
//=需要 jquery.nouislider
在 app/assets/stylesheets 清单文件中:
//=需要 jquery.nouislider
我还安装了 gem。但是我不断收到错误消息:
Showing /home/ubuntu/foodin/app/views/layouts/application.html.erb where line #8 raised:
couldn't find file 'jquery.nouislider'
(in /home/ubuntu/foodin/app/assets/stylesheets/application.css:16)
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
我认为这可能与资产管道有关,但我不确定。有任何想法吗?感谢您的帮助!
编辑:这是我的 development.rb 配置文件,以防它与此有关:
Foodin::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
#NEW: Added for Devise
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
#New:Added for development
config.serve_static_assets = false
end
【问题讨论】:
-
刚安装gem可能需要重启服务器
-
试过了,但我仍然收到下面描述的错误:s
-
Gem 存在一些问题。它也不适合我。通过下载文件并保存在相应的资产目录中使用。
-
您的意思是下载 gem 还是使用 javascript 文件手动完成?
-
是的,不幸的是你必须这样做
标签: javascript css ruby-on-rails pipeline assets