Tôi đã tạo một gem với một thư mục vendor chứa stylesheet và javascripts từ bootstrap-sass và bootstrap.Lấy các tập tin của nhà cung cấp Gem trong đường dẫn đường ống tài sản
Cấu trúc thư mục là bootstrap-sass-đá quý/vendor/tài sản/Javascripts
và
bootstrap-sass-đá quý/vendor/tài sản/stylesheets
Tôi đã yêu cầu đá quý trong một dự án thử nghiệm nhưng bất cứ khi nào tôi cố gắng yêu cầu thứ gì đó từ đá quý đó, tôi nhận được lỗi Sprockets::FileNotFound
.
Ví dụ: trong application.css tôi đã thêm *= require bootstrap
. bootstrap được đặt tại bootstrap-sass-gem/vendor/assets/stylesheets/bootstrap.scss
và do đó, tính toán của tôi sẽ được bao gồm trong đường dẫn nội dung.
Tôi đang chạy RVM Ruby 1.9.2 và Rails 3.1.
Dưới đây là tập tin cấu hình của tôi:
$:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "bootstrap-sass-gem/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "bootstrap-sass-gem"
s.version = BootstrapSassGem::VERSION
s.authors = ["James Smith"]
s.email = ["[email protected]"]
s.homepage = "http://www.smithware.co.uk"
s.summary = "The Bootstrap-sass project Gemified"
s.description = "Description of BootstrapSassGem."
s.files = Dir["{lib,vendor,rdoc}/**/*"] + Dir["*"]
#s.test_files = Dir["test/**/*"]
s.require_paths = ["lib/**/*"]
# We are dependent on the asset pipeline in 3.1.0
s.add_dependency "rails", "~> 3.1.0"
# s.add_development_dependency ""
end
Có thể câu hỏi tôi thực sự muốn hỏi ở đây là: Làm cách nào để tự động đưa các tệp đá quý của tôi vào đường dẫn nội dung? –
Ngay cả sau khi thêm thủ công đường dẫn kiểu dáng Gems vào đường dẫn, tệp bootstrap.scss không tìm thấy. –