我試圖將Padrino和Sinatra-Assetpack結合起來,但沒有成功。Padrino + sinatra-assetpack不能正常工作
這是我的Gemfile:
source :rubygems
gem 'rake'
gem 'sinatra-flash', :require => 'sinatra/flash'
# Component requirements
gem 'haml'
# Assets requirements
gem 'sinatra-assetpack', :require => 'sinatra/assetpack'
# Test requirements
# Padrino Stable Gem
gem 'padrino', '0.10.6'
在我的應用程序/文件app.rb我
設置:
require 'sinatra/assetpack'
class Coffee < Padrino::Application
register Padrino::Rendering
register Padrino::Mailer
register Padrino::Helpers
register Sinatra::AssetPack
assets {
serve '/js', from: '/app/assets/javascripts'
serve '/css', from: '/app/assets/stylesheets'
css :main, ['/css/main.css']
js :application, ['/js/application.js']
}
enable :sessions
end
我的JavaScript文件在/ app /資產/ JavaScript和CSS文件在/ app/assets/stylesheets,但Padrino以/css/main.css和/js/application.js的404響應
任何想法?
感謝
那是很奇怪的。我對這個問題展開了50pt賞金,但從未對這個問題的創造者頒發的,但我沒有拿到50分回來..那是怎麼回事? – 2012-05-08 19:46:27