Closed Bastes closed 12 years ago
If you are still struggling with this, make sure that Bundler.require is below require 'sinatra/base'
in your config.ru
Yep, all is working fine now. Thanks.
should I do the same for Padrino application?
@dirty-hippie No, padrino manage itself the sinatra requirements, you only have to register & configure assetpack. Are you having any issues?
Exemple :
class App < Padrino::Application
register Padrino::Rendering
register Padrino::Helpers
register Sinatra::AssetPack
set :root, File.dirname(__FILE__)
assets {
serve '/public', from: 'assets/public'
serve '/js', from: 'assets/js'
serve '/css', from: 'assets/css'
serve '/img', from: 'assets/img'
# The second parameter defines where the compressed version will be served.
# (Note: that parameter is optional, AssetPack will figure it out.)
js :app, '/js/app.js', [
'/js/vendor/jquery-1.8.3.min.js',
'/js/vendor/jquery.colorbox-min.js',
'/js/vendor/swfobject.js',
'/js/polyfills.js',
'/js/main.js'
]
js :ltie9, '/js/ltie9.js', [
'/js/vendor/html5shiv.js',
'/js/vendor/respond.min.js'
]
css :app, '/css/application.css', [
'/css/vendor/colorbox.css',
'/css/styles.css'
]
js_compression :jsmin # Optional
css_compression :simple # Optional
}
end
The following code :
class App < Sinatra::Base register Sinatra::AssetPack ... end
Failed with the following message : sinatra-assetpack-0.0.11/lib/sinatra/assetpack.rb:60:in
<module:Sinatra>': undefined method
register' for Sinatra:Module (NoMethodError)I tried with Sinatra 1.3.2 and sinatra-assetpack 0.0.11