Closed hongliang-goudou closed 11 years ago
OK. I figured it out. To use sinatra-assetpack precompile under Padrino, the Rakefile should be like this:
APP_FILE = 'app/app.rb'
APP_CLASS = '<Project>::App'
require File.expand_path('config/boot.rb')
require 'bundler/setup'
require 'padrino-core/cli/rake'
require 'sinatra/assetpack/rake'
PadrinoTasks.use(:database)
PadrinoTasks.use(:activerecord)
PadrinoTasks.init
That's it! The importance is to require config/boot.rb. And the rest is that just make sure the spell of your project name is right.
Thanks for reporting! Will add a note in the README about it!
The Rakefile looks like:
The app/app.rb:
And I run:
The result is:
Obvisouly for some reason the rake environment is lack of Padrino::Application. So I modified Rakefile again and required everything explicitly: Rakefile
And it still doesn't work. There're always dependency or incompatible problems. After I solved all of them, I get this final error and can't go any further:
Can anybody help me out of this? Sinatra-AssetPack is a very good and essential part of Sinatra. Why is it so bad compatible with Padrino? I really need the precompile rake work under Padrino. Thanks!