Giter Site home page Giter Site logo

asset_sync's People

Contributors

amatsuda avatar anark avatar andyjeffries avatar arumugaraja-thirumani avatar atyndall avatar d-tasaki avatar davidjrice avatar ejholmes avatar fengb avatar freerobby avatar gordonbondon avatar griffindy avatar jordanrs avatar josacar avatar josephlord avatar jsmestad avatar kamui avatar karlfreeman avatar levent avatar manuelmeurer avatar marcgg avatar minasmart avatar mjonuschat avatar nomoon avatar overture8 avatar pikachuexe avatar rajyan avatar tosbourn avatar webmat avatar zinkkrysty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asset_sync's Issues

Storage::get_remote_files returns non-asset files

Our bucket contains static assets uploaded by asset_sync (in an "assets" directory) as well as a bunch of other files (in other directories, such as "uploads"). Storage::get_remote_files returns everything. This is potentially dangerous, as Storage::delete_extra_remote_files would delete these non-asset files if we enabled it, and if issue 16 wasn't stopping Storage::get_remote_files from working.

Default AssetSync.config.enabled in production/staging env

From a previous issue...

So I think possibly the best way is to have an Array of environments. (Defaulted to production and staging)

AssetSync.configure do |config|
  config.environments = [:production, :staging]
end

This could then be modified by the initializer.
Enabling via YAML and ENV variable might require accepting non-symbol environment names in a comma separated string.

Does not work with heroku using the initializer.

This is my config/initializers/asset_sync.rb:

if Rails.groups.include?("assets")
  AssetSync.configure do |config|
    config.fog_provider          = ENV.fetch("FOG_PROVIDER")
    config.aws_access_key_id     = ENV.fetch("AWS_ACCESS_KEY_ID")
    config.aws_secret_access_key = ENV.fetch("AWS_SECRET_ACCESS_KEY")
    config.fog_directory         = ENV.fetch("FOG_DIRECTORY")
    config.fog_region            = ENV.fetch("FOG_REGION")
    config.existing_remote_files = "delete"
    config.gzip_compression      = true
    config.fail_silently         = false
  end
end

When I git push heroku, however, I get NO output from AssetSync:

-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
-----> Rails plugin injection

I have the user_env_compile plugin installed, and I can confirm that the environment variables are present when the environment is initialized (I have added puts statements to the asset_sync initializer to confirm this).

What I have to do to deploy the assets is locally run rake assets:precompile assets:clean. I have a (git-ignored) config/asset_sync.yml file that is used when compiling locally. I would rather not add my AWS credentials to the git repository.

I'm running:

  • asset_sync (0.2.8)
  • rails (3.2.1)
  • sprockets (2.1.2)

Any ideas what might be wrong? It's a pain to remember to manually sync the assets before git push heroku, so any help is appreciated :)

plugin heroku-labs has been deprecated

... so what about

heroku plugins:install https://github.com/heroku/heroku-labs.git
heroku labs:enable user_env_compile -a myapp

to evoid the deploy precompile error on Heroku ?

-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       Fog provider can't be blank, Fog directory can't be blank
       
       Tasks: TOP => assets:precompile:nondigest

Asset_sync when compiling dynamically

I have some assets that I don't want precompiled (like the admin panel) because they take time during our deploy and are served as part of the minified assets to all users. I can take them out of the precompile array and enable dynamically serving assets but when rails compiles them dynamically, asset_sync doesn't sync them to s3, yet the app still looks for the assets on s3. Is there a way around this?

Files that already exist on S3 are still uploaded

We have many more than 1000 files in our S3 bucket, but the default value for max-keys in fog is 1000. This means that AssetSync::Storage::get_remote_files only returns the first 1000 files found, meaning that, although local_files_to_upload should be empty, it ends up containing many thousands of files.

Apparently unnecessarily warning

Every time the environment is loaded the following warning is displayed:

AssetSync: using /Users/Leandro/Sites/NewProject/config/initializers/asset_sync.rb

The version of asset_sync i'm using is 0.1.7.

refreshing assets within cloudfront

I made a change to my css and ran:

RAILS_GROUP=assets RAILS_ENV=development bundle exec rake assets:precompile --trace

I don't see any output of it uploading anything new.

/Users/karl/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
/Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/bin/rake
assets:precompile:all RAILS_ENV=development RAILS_GROUPS=assets --trace
rake/gempackagetask is deprecated.  Use rubygems/package_task instead
rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
** Invoke assets:precompile:all (first_time)
** Invoke add_assets_precompile_environment_var (first_time)
** Execute add_assets_precompile_environment_var
adding assets precompile env variable
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Invoke disable_rails_admin_initializer (first_time)
** Execute disable_rails_admin_initializer
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Invoke disable_rails_admin_initializer (first_time)
** Execute disable_rails_admin_initializer
** Execute environment
Using: Directory Search of
/Users/karl/workspace/viewthespace/public/assets

And when i look at the application.css, it is the older version still.

So i have two questions:

  1. Why didn't it upload the new version?
  2. Even if it did upload the version, how would it get refreshed within amazon cloudfront?

thx!

Rake aboirted: Is a directory - /app/app/assets

Running with Rails 3.1.3 and Heroku cedar I get this error:

rake aborted!
Is a directory - /app/app/assets
/app/vendor/bundle/ruby/1.9.1/gems/asset_sync-0.2.3/lib/asset_sync/storage.rb:36:in `read'
/app/vendor/bundle/ruby/1.9.1/gems/asset_sync-0.2.3/lib/asset_sync/storage.rb:36:in `get_local_files'
/app/vendor/bundle/ruby/1.9.1/gems/asset_sync-0.2.3/lib/asset_sync/storage.rb:30:in `local_files'
/app/vendor/bundle/ruby/1.9.1/gems/asset_sync-0.2.3/lib/asset_sync/storage.rb:123:in `upload_files'
/app/vendor/bundle/ruby/1.9.1/gems/asset_sync-0.2.3/lib/asset_sync/storage.rb:134:in `sync'
/app/vendor/bundle/ruby/1.9.1/gems/asset_sync-0.2.3/lib/asset_sync/asset_sync.rb:29:in `sync'
/app/vendor/bundle/ruby/1.9.1/gems/asset_sync-0.2.3/lib/tasks/asset_sync.rake:6:in `block in <top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `load'
/app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile

Anything I could do to better debug this?

With compression enabled, what happens if browser doesn't support gzip?

Sorry first if this is the wrong place for the post, but I'm wondering about this:

With the gzip_compression option enabled, when uploading your assets. If a file has a gzip compressed equivalent we will replace that asset with the compressed version and sets the correct headers for S3 to serve it

Now I need to set the content-encoding to gzip for gz files, and then decide which one to serve for the user. But what this seems to do is remove the uncompressed file, so I'm wondering what will happen for browsers that don't support compression.

Using a subfolder on production

Hi Guys,

we're using a subfolder /a/ on our production environment. This is done with passenger_base_uri /a
The app is now looking for /a/assets/ on our CloudFront domain, but your gem is putting everything in /assets/.
Can you support a subfolder setting in your config like fog_sub_directory or do I miss any other easy solution?

Best,
Konstantin

Assets aren't uploaded on Heroku deploy

I'm using Rails 3.1.RC6 and have added asset_sync into my project for deploy to Heroku. When I deploy with a new git push, the assets are not uploaded to my S3 bucket. However, if I run

heroku run rake assets:precompile

then they are uploaded successfully. This implies that the setup is correct but for some reason the rake task isn't getting run on deploy. I'll open a ticket with Heroku as well, but given that you mention this will work "automagically" I wondered if you had any ideas?

Error on running assets precompile

I'm not sure I'm understanding what's going on here, I've done the asset config, set fail silent to true as per docs, config looks ok, but after heroku deploy when I run the rake I get this:

$ heroku run rake assets:precompile --trace
Running rake assets:precompile --trace attached to terminal... up, run.1
** Invoke assets:precompile (first_time)
** Execute assets:precompile
mkdir -p /app/public/assets
rake aborted!
Permission denied - /app/public/assets

Where is the mkdir failing? on S3? Permissions issue on S3? Heroku issue?

Thanks for any help.

asset_sync doesn't respect config.assets.prefix

For example, if you have different asset sets for staging, production, etc. you may wish to use this to store your assets in different directories:

staging.rb
config.assets.prefix = "assets-staging"

production.rb  
# use the default of:
# config.assets.prefix = "assets"

When you run the assets:precompile task, all assets in your staging environment are taken from your local public/assets and uploaded to /assets in the corresponding amazon bucket regardless of the prefix setting.

Calculation of local_files_to_upload is incorrect

In AssetSync::Storage::upload_files, the list of files to upload is calculates as follows:

local_files_to_upload = (remote_files | local_files) - (remote_files & local_files)

This means that asset_sync will attempt to upload files that are present in remote_files but which are not present in local_files. This will break if, for example, the assets directory is cleaned, but old versions of assets are being kept on S3. Perhaps this should be changed to:

local_files_to_upload = local_files - remote_files

Refreshing of the asset cache

Sorry this is not an issue... just a question. How does asset_sync refresh the cloudfront cache when new assets are uploaded? From what i understand, cloudfront caches files for 24 hours.

thx!

Fog directory can't be blank

Trying to run locally as described here: http://devcenter.heroku.com/articles/cdn-asset-host-rails31

Set the FOG_DIRECTORY but it does not seem to be picked up:

karl:viewthespace karl$ echo $FOG_DIRECTORY
vts-image-uploads

karl:viewthespace karl$ RAILS_GROUP=assets RAILS_ENV=development bundle exec rake assets:precompile --trace
rake/gempackagetask is deprecated.  Use rubygems/package_task instead
rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/karl/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/bin/rake assets:precompile:all RAILS_ENV=development RAILS_GROUPS=assets --trace
rake/gempackagetask is deprecated.  Use rubygems/package_task instead
rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
** Invoke assets:precompile:all (first_time)
** Invoke add_assets_precompile_environment_var (first_time)
** Execute add_assets_precompile_environment_var
adding assets precompile env variable
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Invoke disable_rails_admin_initializer (first_time)
** Execute disable_rails_admin_initializer
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Invoke disable_rails_admin_initializer (first_time)
** Execute disable_rails_admin_initializer
** Execute environment
rake aborted!
Fog directory can't be blank
/Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/asset_sync-0.2.1/lib/asset_sync/asset_sync.rb:24:in `sync'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/asset_sync-0.2.1/lib/tasks/asset_sync.rake:6:in `block in <top (required)>'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/karl/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/bin/rake:19:in `load'
/Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile

I am running ruby-1.9.2 on rails3.1.3.

I am also getting this error on heroku.

thx!

-karl

Precompile failing to sync (403 Forbidden)

I have not been able to get my assets to sync to my amazon bucket. I know that my app has access to the bucket, as I have given it permission via a group policy shown below, but no matter what I have tried I can't get my assets to sync. I keep getting a HTTP 403 error code.

ruby-1.9.2-p290

gem 'rails', '3.1.1'
gem 'asset_sync', '~> 0.1.9'
AssetSync.configure do |config|
  config.aws_access_key = '[KEY]'
  config.aws_access_secret = '[SECRET]'
  config.aws_bucket = '[bucket]'
  config.existing_remote_files = "keep"
  # Increase upload performance by configuring your region
  # config.aws_region = "eu-west-1"
  # Automatically replace files with their equivalent gzip compressed version
  # config.gzip_compression = true
end

on push to heroku

-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       /tmp/build_10dnyp6p3sc0u/vendor/bundle/ruby/1.9.1/gems/airbrake-3.0.4/lib/airbrake.rb:134:in `send_notice': undefined method `send_to_airbrake' for nil:NilClass (NoMethodError)
       from /tmp/build_10dnyp6p3sc0u/vendor/bundle/ruby/1.9.1/gems/airbrake-3.0.4/lib/airbrake.rb:103:in `notify'
       from /tmp/build_10dnyp6p3sc0u/vendor/bundle/ruby/1.9.1/gems/airbrake-3.0.4/lib/airbrake/rake_handler.rb:15:in `display_error_message_with_airbrake'
       from /tmp/build_10dnyp6p3sc0u/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:142:in `rescue in standard_exception_handling'
       from /tmp/build_10dnyp6p3sc0u/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:132:in `standard_exception_handling'
       from /tmp/build_10dnyp6p3sc0u/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
       from /tmp/build_10dnyp6p3sc0u/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
       from /tmp/build_10dnyp6p3sc0u/vendor/bundle/ruby/1.9.1/bin/rake:19:in `load'
       from /tmp/build_10dnyp6p3sc0u/vendor/bundle/ruby/1.9.1/bin/rake:19:in `<main>'
       Precompiling assets failed, enabling runtime asset compilation
       Injecting rails31_enable_runtime_asset_compilation
       Please see this article for troubleshooting help:
       http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting

compiling from command line

[staging][~/goswim] heroku run rake assets:precompile --app staging-goswim
Running rake assets:precompile attached to terminal... up, run.6
/usr/local/bin/ruby /app/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
** [NewRelic][11/14/11 12:18:58 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (31)] INFO : Dispatcher: thin
** [NewRelic][11/14/11 12:18:58 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (31)] INFO : Application: staging-goswim
** [NewRelic][11/14/11 12:18:58 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (31)] INFO : New Relic Ruby Agent 3.2.0.1 Initialized: pid = 31
** [NewRelic][11/14/11 12:18:59 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (31)] INFO : NewRelic::Agent::Samplers::DelayedJobLockSampler sampler not available: No DJ worker present
** [NewRelic][11/14/11 12:19:09 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (31)] INFO : Resolved collector.newrelic.com to 204.93.223.153
** [NewRelic][11/14/11 12:19:10 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (31)] INFO : Resolved collector-3.newrelic.com to 204.93.223.137
Connected to NewRelic Service at collector-3.newrelic.com:80
** [NewRelic][11/14/11 12:19:10 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (31)] INFO : Reporting performance data every 60 seconds.
/usr/local/bin/ruby /app/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets
** [NewRelic][11/14/11 12:19:33 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (64)] INFO : Dispatcher: thin
** [NewRelic][11/14/11 12:19:33 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (64)] INFO : Application: staging-goswim
** [NewRelic][11/14/11 12:19:33 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (64)] INFO : New Relic Ruby Agent 3.2.0.1 Initialized: pid = 64
** [NewRelic][11/14/11 12:19:33 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (64)] INFO : NewRelic::Agent::Samplers::DelayedJobLockSampler sampler not available: No DJ worker present
** [NewRelic][11/14/11 12:19:42 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (31)] WARN : Disabling serialization: Read-only file system - /newrelic_agent_store.db
** [NewRelic][11/14/11 12:19:46 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (6)] INFO : Dispatcher: thin
** [NewRelic][11/14/11 12:19:46 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (6)] INFO : Application: staging-goswim
** [NewRelic][11/14/11 12:19:46 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (6)] INFO : New Relic Ruby Agent 3.2.0.1 Initialized: pid = 6
** [NewRelic][11/14/11 12:19:46 +0000 5e3c3c91-52bc-41eb-87a1-9dc3a92768fa (6)] INFO : NewRelic::Agent::Samplers::DelayedJobLockSampler sampler not available: No DJ worker present
rake aborted!
Expected(200) <=> Actual(403 Forbidden)
  request => {:connect_timeout=>60, :headers=>{"Date"=>"Mon, 14 Nov 2011 12:19:49 +0000", "Authorization"=>"AWS [KEY]:[pass]", "Host"=>"[bucket].s3.amazonaws.com:443", "Content-Length"=>0}, :host=>"[bucket].s3.amazonaws.com", :mock=>nil, :path=>"/", :port=>"443", :query=>{}, :read_timeout=>60, :scheme=>"https", :write_timeout=>60, :expects=>200, :idempotent=>true, :method=>"GET"}
  response => #<Excon::Response:0x00000005dd06f8 @body="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>59E95DA3405C280D</RequestId><HostId>FtbIFLAD3oK4LQLnqgX8uygY+8kRXbpLaTPWTUjdtmxrTE2n1J0UDlAzJHe6jf7d</HostId></Error>", @headers={"x-amz-request-id"=>"59E95DA3405C280D", "x-amz-id-2"=>"FtbIFLAD3oK4LQLnqgX8uygY+8kRXbpLaTPWTUjdtmxrTE2n1J0UDlAzJHe6jf7d", "Content-Type"=>"application/xml", "Transfer-Encoding"=>"chunked", "Date"=>"Mon, 14 Nov 2011 12:19:49 GMT", "Server"=>"AmazonS3"}, @status=403>

Tasks: TOP => assets:precompile

And a resultant Log from my S3 Bucket

fd69332feeccfaac7caf291d645bda05c982f1c6bb12d29015c3cdf7ef5a882d [bucket] [14/Nov/2011:11:08:28 +0000] 195.241.148.235 arn:aws:iam::[user]:user/[group] FCC131D7A7B1BE76 REST.GET.BUCKET - "GET / HTTP/1.1" 403 AccessDenied 231 - 15 - "-" "-" -
fd69332feeccfaac7caf291d645bda05c982f1c6bb12d29015c3cdf7ef5a882d [bucket] [14/Nov/2011:11:17:27 +0000] 10.194.22.16 3272ee65a908a7677109fedda345db8d9554ba26398b2ca10581de88777e2b61 2BE3A542843C517D REST.PUT.OBJECT logs2011-11-14-11-17-27-8464AC8CEC983217 "PUT /[bucket]/logs2011-11-14-11-17-27-8464AC8CEC983217 HTTP/1.1" 403 AccessDenied 231 818 19 - "-" "Jakarta Commons-HttpClient/3.0" -
fd69332feeccfaac7caf291d645bda05c982f1c6bb12d29015c3cdf7ef5a882d [bucket] [14/Nov/2011:11:22:14 +0000] 10.119.93.14 fd69332feeccfaac7caf291d645bda05c982f1c6bb12d29015c3cdf7ef5a882d 6120BB9FAEA5BFAA REST.GET.BUCKET - "GET /[bucket]?prefix=&max-keys=100&marker=&delimiter=/ HTTP/1.1" 200 - 1136 - 41 39 "-" "S3Console/0.4" -
fd69332feeccfaac7caf291d645bda05c982f1c6bb12d29015c3cdf7ef5a882d [bucket] [14/Nov/2011:11:22:21 +0000] 10.194.64.24 fd69332feeccfaac7caf291d645bda05c982f1c6bb12d29015c3cdf7ef5a882d 959249E37A0007D9 REST.GET.BUCKETPOLICY - "GET /[bucket]?policy HTTP/1.1" 404 NoSuchBucketPolicy 297 - 41 - "-" "S3Console/0.4" -

my user group policy should give my S3 user account access to all actions on the S3 bucket, and it shouldn't be rejected

{
  "Statement": [
    {
      "Sid": "staging",
      "Action": "s3:*",
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::[bucket]/*"
    }
  ]
}

Log what mode of configuration is being used

In the engine.rb it would be a good idea to re-enable logging to debug if we are:

  • using a built-in initializer
  • using a custom initializer
  • using a YAML file

We may also want to consider loading the ENV variables part of the built in initializer to ensure that if a user has defined a custom initializer but commented it out... we will still capture the other ENV vars. (Related to #49)

md5 hash problem

Hi,

All image files do get uploaded to the bucket, but they are renamed to include the md5 hash and image_path helper in SASS still links to the original filename. Is this a bug?

Rails.application.config.assets.prefix returns "/assets"

Seems to be a small issue with 0.2.4 and the Rails 3-2-stable branch. Rails.application.config.assets.prefix returns "/assets" if not set explicitly, which creates "/ /assets" on S3. Will check if explicitly setting config.assets.prefix to "assets" solves it.

Initializer looks like:

AssetSync.configure do |config|
config.fog_provider = 'AWS'
config.aws_access_key_id =
config.aws_secret_access_key =
config.fog_directory = 'assets-staging' #ENV['FOG_DIRECTORY']

Increase upload performance by configuring your region

config.fog_region = ''

Don't delete files from the store

config.existing_remote_files = "delete"

Automatically replace files with their equivalent gzip compressed version

config.gzip_compression = true

Use the Rails generated 'manifest.yml' file to produce the list of files to

upload instead of searching the assets directory.

config.manifest = true

end

[GitHub]a5fcbf2

Setting Expires header for uploaded items

The only issue I've seen with this gem is that it doesn't set an Expires HTTP header to the far-future when it uploads the assets to S3. This would be a great performance enhancement.

I may work on adding this myself, but I wanted to make sure that this was an appropriate addition.

Automagic asset compression

I've written a monkeypatch for AssetSync::Storage#upload_file that automagically replaces assets with gzipped versions. You may want to consider implementing its functionality (although perhaps in a user-configurable manner).

# automagically compress assets
if defined?(AssetSync)
  gem 'asset_sync', '= 0.1.8' # die early if asset_sync may have changed

  class AssetSync::Storage
    def upload_file(f)
      STDERR.puts "Uploading: #{f}"

      gzip = File.exist?("#{path}/#{f}.gz") # enable gzip compression if a gz asset exists
      name = gzip ? f + '.gz' : f # use the gzipped asset's contents
      mime = Mime::Type.lookup_by_extension File.extname(f)[1..-1] # detect MIME type

      file = bucket.files.create(
        :key              => "#{f}",
        :body             => File.open("#{path}/#{name}"),
        :public           => true,
        :cache_control    => "max-age=31557600",
        :content_type     => mime, # explicitly provide content-type for assets AWS isn't aware of
        :content_encoding => gzip ? 'gzip' : nil # gzipped-assets require Content-Encoding header
      )
    end
  end
end

config.existing_remote_files = 'delete' doesn't seem to work

I have the option set in my initializer but still my S3 folder is littered with old asset files.
On every deploy it says

 ** [out :: myapp.com] Fetching files to flag for delete
 ** [out :: myapp.com] Flagging 0 file(s) for deletion

What could be the cause?

multiple environments on heroku

Every time I try to run 'heroku run bundle exec rake assets:precompile' against my staging environment, three files are generated: one for production, one for staging, and one without a digest. I'd like to only generate the fingerprinted staging assets and leave out the others.

Unknown region: "sa-east-1"

There is problem with São Paulo Region in fog. Whenever I ran rake assets:precompile i got the error above. The assets compile successfully but they are not synced.

I'm using asset_sync 0.3.1 that uses fog 0.9.0. The bug is reported on fog.

According to fog forums, it was corrected in newer versions of fog, at least it was corrected 3 months ago in fog.

Is that a case of updating dependencies?

Sorry, 0.2.12 with Rails 3.2.2 on Heroku Does Not Work.

Doing heroku push staging master results in:

      <...>
       Your bundle is complete! It was installed into ./vendor/bundle
       Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       Fog provider can't be blank, Fog directory can't be blank

       Tasks: TOP => assets:precompile:nondigest
       (See full trace by running task with --trace)
       Precompiling assets failed, enabling runtime asset compilation
       Injecting rails31_enable_runtime_asset_compilation
       Please see this article for troubleshooting help:
       http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting
-----> Rails plugin injection
       Injecting rails_log_stdout
       Injecting rails3_serve_static_assets

Yes, I have user_env_compile set:

# heroku labs --remote staging
=== App Features (xxxxx-xxxxx-5305)
[+] user_env_compile          # Add user config vars to the environment during slug compilation

=== User Features ([email protected])
[ ] heroku-shared-postgresql  # PostgreSQL 9.1 shared database service.

Thought it might be because I was using Ruby 1.9.3-p0, so I switched back to 1.9.2. No difference.

Tried heroku run rake assets:precompile --remote staging with (deprecation warnings removed):

Running rake assets:precompile attached to terminal... up, run.1
/app/vendor/ruby-1.9.3-p0/bin/ruby /app/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
WARNING on line 384 of /app/app/assets/stylesheets/theme_base.css.sass:
This selector doesn't have any properties and will not be rendered.
WARNING on line 434 of /app/app/assets/stylesheets/theme_base.css.sass:
This selector doesn't have any properties and will not be rendered.
WARNING on line 300 of /app/app/assets/stylesheets/partials/_screen.css.sass:
This selector doesn't have any properties and will not be rendered.
WARNING on line 409 of /app/app/assets/stylesheets/partials/_screen.css.sass:
This selector doesn't have any properties and will not be rendered.

rake aborted!
Fog provider can't be blank, Fog directory can't be blank

Tasks: TOP => assets:precompile:nondigest
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/app/vendor/ruby-1.9.3-p0/bin/ruby /app/ve...]

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

Null Asset Directory

Using jQuery.syntax for syntax highlighting on a rails 3.1 server we are getting issues once migrating our assets to the cloud. Syntax highlighting works locally with no JS errors, but when deployed to heroku using asset_sync we get /nulljquery.syntax.core.js GET requests to our server. Why would rails think that a precompiled asset was stored at this location when we can see that during asset precompilation, the file has already been stored on S3:

Ignoring: assets/jquery.syntax.core-d8b38d86909c8843afd05425d9ace884.js.gz

Here is the contents of our application.js file:

//= require jquery
//= require jquery_ujs
//= require jquery_nested_form
//= require jquery.syntax.min

Local files should perhaps be built from the manifest.yml

The manifest file specified in config.assets.manifest contains a mapping between local filenames and compiled assets. Perhaps AssetSync::Storage::local_files could read the manifest, rather than iterating over the contents of public/assets (which may not have been cleaned, and which definitely contains the files without the CRC as well as the files with the CRC).

CSS not uploaded to S3

Hi,

I just started using asset_sync and am not sure if I'm missing something obvious. It could be that I have my asset pipeline misconfigured. I'm not seeing any of my CSS files being uploaded to my S3 bucket. Any idea why this might be the case? It exists in my Rails app on Heroku, but the corresponding file is not on S3.

Thanks for any insight!

EDIT: I did have to disable CSS compression because there is a Rails error having to do with SASS.... Not sure if that could have to do with it?

~Joel

Aws access key can't be blank, Aws access secret can't be blank, Aws bucket can't be blank

Hi

I follow the readme (Hardcode S3 credential)

When I launch assets:precompile I get : Aws access key can't be blank, Aws access secret can't be blank, Aws bucket can't be blank

But my credential is OK

defaults: &defaults
aws_access_key: 'KEY'
aws_access_secret: 'SECRET'
aws_region: 'eu-west-1'
existing_remote_files: keep
production:
<<: *defaults
aws_bucket: "bucket"

I try to "fixe" and this work when I change the asset_sync.rb in config : @config ||= Config.new to @config = Config.new

Seems the config is call 2 times, and the first it initialize aws_access_key with nil

Is there a verbose option?

It would be nice to see a summary of what happened during a sync operation but I didn't see anything in the config options.

Great library btw!

This asset host cannot be computed without a request in scope. Remove the second argument to your asset_host Proc if you do not need the request, or make it optional.

I get this when uploading to Heroku

   Running: rake assets:precompile
   AssetSync: using default configuration from built-in initializer
   Compiled jquery.js  (1ms)  (pid 1209)
   Compiled jquery_ujs.js  (0ms)  (pid 1209)
   Compiled jquery.iframe-transport.js  (0ms)  (pid 1209)
   Compiled jquery.remotipart.js  (5ms)  (pid 1209)
   Compiled bootstrap-alert.js  (0ms)  (pid 1209)
   Compiled bootstrap-dropdown.js  (0ms)  (pid 1209)
   Compiled bootstrap-modal.js  (0ms)  (pid 1209)
   Compiled bootstrap-tab.js  (0ms)  (pid 1209)
   Compiled bootstrap.js  (0ms)  (pid 1209)
   Compiled jquery.lightbox-0.5.min.js  (0ms)  (pid 1209)
   Compiled application.js  (123ms)  (pid 1209)
   Compiled bootstrap.css  (0ms)  (pid 1209)
   Compiled chart.css  (0ms)  (pid 1209)
   Compiled custom.css  (0ms)  (pid 1209)
   Compiled jquery.lightbox-0.5.css  (0ms)  (pid 1209)
   Compiled application.css  (13ms)  (pid 1209)
   Compiled iPhone.css.old  (0ms)  (pid 1209)
   Compiled scaffold.css.old  (0ms)  (pid 1209)
   Compiled rails_admin/jquery.colorpicker.js  (0ms)  (pid 1209)
   Compiled jquery.effects.core.js  (0ms)  (pid 1209)
   Compiled jquery.ui.core.js  (1ms)  (pid 1209)
   Compiled jquery.ui.widget.js  (0ms)  (pid 1209)
   Compiled jquery.ui.mouse.js  (2ms)  (pid 1209)
   Compiled jquery.ui.sortable.js  (68ms)  (pid 1209)
   Compiled jquery.ui.position.js  (0ms)  (pid 1209)
   Compiled jquery.ui.autocomplete.js  (6ms)  (pid 1209)
   Compiled jquery.ui.datepicker.js  (1ms)  (pid 1209)
   Compiled rails_admin/jquery.ui.timepicker.js  (0ms)  (pid 1209)
   Compiled rails_admin/ra.datetimepicker.js  (0ms)  (pid 1209)
   Compiled rails_admin/ra.filter-box.js  (0ms)  (pid 1209)
   Compiled rails_admin/ra.filtering-multiselect.js  (0ms)  (pid 1209)
   Compiled rails_admin/ra.filtering-select.js  (0ms)  (pid 1209)
   Compiled rails_admin/ra.remote-form.js  (0ms)  (pid 1209)
   Compiled rails_admin/jquery.pjax.js  (0ms)  (pid 1209)
   Compiled jquery_nested_form.js  (0ms)  (pid 1209)
   Compiled rails_admin/ra.nested-form-hooks.js  (151ms)  (pid 1209)
   Compiled rails_admin/ui.js  (176ms)  (pid 1209)
   Compiled rails_admin/themes/default/ui.js  (0ms)  (pid 1209)
   Compiled rails_admin/custom/ui.js  (0ms)  (pid 1209)
   Compiled rails_admin/rails_admin.js  (539ms)  (pid 1209)
   rake aborted!
   This asset host cannot be computed without a request in scope. Remove the second argument to your asset_host Proc if you do not need the request, or make it optional.
   (in /tmp/build_3abhna11koms2/vendor/bundle/ruby/1.9.1/bundler/gems/rails_admin-576e3e4cfada/app/assets/stylesheets/rails_admin/jquery.colorpicker.css.scss)

It's on Heroku with Ruby 1.9.3.p0 and Rails 3.2.1.

config.action_controller.asset_host = Proc.new do |source, request|
request.ssl? ? "https://#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com" : "http://#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"
end

If I change the above lines to the old one below, it works just fine.

config.action_controller.asset_host = "http://#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"

Is this related to the following Rails issue or seperate one?

rails/rails#2947

Works with Rails 3.2.0?

I just upgraded to Rails 3.2.0 and asset_sync 0.2.5 and it doesn't seem to work.
I followed the upgrade instructions in the Readme and everything went fine, but when I deploy with Capistrano, the assets are not uploaded to S3.

This is my config/initializers/asset_sync.rb:

AssetSync.configure do |config|
  config.fog_provider          = 'AWS'
  config.aws_access_key_id     = AppConfig.aws[:key]
  config.aws_secret_access_key = AppConfig.aws[:secret]
  config.fog_directory         = AppConfig.aws[:bucket]

  # Increase upload performance by configuring your region
  config.fog_region = AppConfig.aws[:region]

  # Don't delete files from the store
  config.existing_remote_files = 'delete'

  # Automatically replace files with their equivalent gzip compressed version
  config.gzip_compression = true

  # Use the Rails generated 'manifest.yml' file to produce the list of files to
  # upload instead of searching the assets directory.
  # config.manifest = true

  # Fail silently. Useful for environments such as Heroku
  # config.fail_silently = true
end

and my lib/tasks/asset_sync.rake:

Rake::Task['assets:precompile'].enhance do
  AssetSync.sync
end

When I call AssetSync.sync from the Rails console on production after deploy, it works as expected and the assets are uploaded.

Assets compiled twice on server

Hello,
Rails 3.2.1, Capistrano, RVM, asset_sync (master), EC2

In order for asset_sync to upload something to S3 I had to write a Rake task as pointed out in another ticket:

Rake::Task["assets:precompile:nondigest"].enhance do
  Rake::Task["assets:environment"].invoke if Rake::Task.task_defined?("assets:environment")
  AssetSync.sync
end

The problem is that I'm seeing that during the deploy the server compiles the assets two times.

Capfile contains load 'deploy/assets', digest are enabled.

Maybe related:
rails/rails#3192

Public folder assets are not synced

Some gems, like ckeditor put their JS files in your public folder. Is there any way to ensure that /public/javascripts gets pushed to S3 along with all my other assets? I'm using latest asset_sync with initializer.rb

asset_path in css.erb is not properly handled

Just bumped into the issue that css.erb is not handled properly. As you can see below, the region is missing.

css.erb

body {width:100%; height: 100%;padding:0; margin:0; font-family:Arial, verdana, sans-serif;background:#fff url('<%= asset_path 'main/bg_body.gif' %>') repeat-y center 0;}

processed css

body{width:100%;height:100%;padding:0;margin:0;font-family:Arial, verdana, sans-serif;background:#fff url("http://.s3.amazonaws.com/assets/main/bg_body-0cb881d8e11ed182a85fddb437b7687e.gif") repeat-y center 0}

Any other files have no problems.

Ruby 1.9.3-p0 / Rails 3.2.1 on Heroku
It works just fine on local

excon 0.10.0 released and stack trace

Hello,

Gemfile (relevant parts) if you want to test:

gem 'asset_sync', '~> 0.3.1'
gem 'fog', :git => 'git://github.com/fog/fog.git'
gem 'excon', '>= 0.9.6'

I'm getting this now during precompilation:

** Invoke assets:precompile (first_time)
** Execute assets:precompile
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
Starting revision: SHA 57995716599e8886f39a685a76cabe1534d7fc50
AssetSync: using /Users/kain/Sites/myapp/rails/config/initializers/asset_sync.rb
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
** Invoke assets:precompile:nondigest (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
Starting revision: SHA 57995716599e8886f39a685a76cabe1534d7fc50
AssetSync: using /Users/kain/Sites/myapp/rails/config/initializers/asset_sync.rb
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:nondigest
AssetSync: Syncing.
Using: Manifest /Users/kain/Sites/myapp/rails/public/assets/manifest.yml
Uploading: /Users/kain/Sites/myapp/rails/public/assets/player-69ae6b7aee678556bd9a8117d61f02fd.js.gz in place of assets/player-69ae6b7aee678556bd9a8117d61f02fd.js saving 27.68%
rake aborted!
undefined method `empty?' for #<File:0x007fdccc2cec90>
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/excon-0.10.0/lib/excon/connection.rb:211:in `request_kernel'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/excon-0.10.0/lib/excon/connection.rb:92:in `request'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/bundler/gems/fog-2a4abcd092b7/lib/fog/core/connection.rb:20:in `request'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/bundler/gems/fog-2a4abcd092b7/lib/fog/aws/storage.rb:359:in `request'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/bundler/gems/fog-2a4abcd092b7/lib/fog/aws/requests/storage/put_object.rb:43:in `put_object'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/bundler/gems/fog-2a4abcd092b7/lib/fog/aws/models/storage/file.rb:133:in `save'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/bundler/gems/fog-2a4abcd092b7/lib/fog/core/collection.rb:50:in `create'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/asset_sync-0.3.1/lib/asset_sync/storage.rb:121:in `upload_file'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/asset_sync-0.3.1/lib/asset_sync/storage.rb:133:in `block in upload_files'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/asset_sync-0.3.1/lib/asset_sync/storage.rb:131:in `each'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/asset_sync-0.3.1/lib/asset_sync/storage.rb:131:in `upload_files'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/asset_sync-0.3.1/lib/asset_sync/storage.rb:140:in `sync'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/asset_sync-0.3.1/lib/asset_sync/asset_sync.rb:29:in `sync'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/asset_sync-0.3.1/lib/tasks/asset_sync.rake:3:in `block in <top (required)>'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/kain/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/bin/rake:19:in `load'
/Users/kain/.rvm/gems/ruby-1.9.3-p125/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile:nondigest

What do you suggest to disable asset_sync? (precompile => PhoneGap)

Hey guys,

I love the simplicity of asset_sync. I've recently set it up to deploy my mobile web app's assets to a CDN and it works like a charm!

However I need to precompile my assets for a PhoneGap app, and I can't find any obvious way to simply turn off AssetSync in that scenario.

I've created a dummy config/environments/hybrid.rb to tweak the asset pipeline for my app's needs.

I've tried creating config/initializers/asset_sync.rb and wrapping the config block in a if that checks for the proper Rails.env, but precompilation still fails with Fog provider can't be blank, Fog directory can't be blank.

Any suggestions?

I'm currently looking at the code to see if I can figure out a clean patch I could contribute. But if you already have something in mind, I'd love to hear about it.

Thanks!

Error with rails 3.1.1

Hello,

According to 3.1.1 release note :

"rake assets:precompile loads the application but does not initialize it.

To the app developer, this means configuration add in config/initializers/* will not be executed.

Plugins developers need to special case their initializers that are meant to be run in the assets group by adding :group => :assets. [José Valim]"

Does'nt works with initializer or yml.

Mickael.

Doesn't look outside public/assets

Our rails app has a custom config.asset.prefix, when running the assets:precompile the asset sync only looks in the default asset location "public/assets"

"Using: Directory Search of ***/public/assets
Done."

Rails 3.2.1
Ruby 1.9.2
Asset_sync (0.3.1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.