Closed spullen closed 11 years ago
Try without prebuild true
, this feature might be broken (haven't read the whole code yet and this part is still mysterious to me).
This might be an issue with https://github.com/sinatra/sinatra/issues/577 Which would cause this https://github.com/rstacruz/sinatra-assetpack/blob/master/lib/sinatra/assetpack/helpers.rb#L47 not to work properly.
In my app I printed out settings.production?.to_s
and that returned false! even though settings.environment # => :production
.
I tried removing the prebuild true
, no dice.
Can you also try setting RACK_ENV=production
as it might depends on it? Not sure what -e production does exactly.
setting the RACK_ENV explicitly didn't work either.
And downgrading or upgrading sinatra? Last tests were run with 1.3.4 not 1.3.5
I have it working now. I have sinatra/contrib and sinatra/config_file:
...
register Sinatra::ConfigFile
config_file settings.root + '/config/config.yml'
...
I commented out those two lines (the config had nothing in it anyways) and it worked. Is there a known confliction between the two libraries?
No known conflict, but seems indeed to be related and I would guess sinatra config does not set the environment variable in the way expected by sinatra/sinatra-assetpack.
Tests succeed, will be in next release, for now use edge :
gem 'sinatra-assetpack', :git => 'git://github.com/rstacruz/sinatra-assetpack.git'
In production it just seems to be doing the same thing as it does in development, serves each individual file. I have the prebuild flag set to true, and I see it create both the js and css minimized files. And if I explicitly go to those files in the browser they exist.
Here is my assets config
In my view I have
And the output from
thin start -p 4567 -e production
orrackup -p 4567 -E production
:Edit: Also, I'm using sinatra-assetpack 0.1.5