mały problem z paperclip i miniaturkami

Witam,

Mam kłopot z paperclip i tworzeniem miniaturki

To działa:

has_attached_file :images, :url => "/assets/products/:id/:style/:basename.:extension", :path => ":rails_root/public/assets/products/:id/:style/:basename.:extension"
to nie działa: Tutaj nawet formularz się nie zapisuję…

has_attached_file :images, :styles => { :small => "150x150>" }, :url => "/assets/products/:id/:style/:basename.:extension", :path => ":rails_root/public/assets/products/:id/:style/:basename.:extension"
W logu mam taki błąd: (o ile go dobrze wyłapałem)

[code] Rendered /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.4ms)

Started GET “/assets/wall/1/medium/bg_wo_video_language.jpg” for 89.79.218.16 at 2012-11-29 14:35:08 +0100
Served asset /wall/1/medium/bg_wo_video_language.jpg - 404 Not Found (10ms)

ActionController::RoutingError (No route matches [GET] “/assets/wall/1/medium/bg_wo_video_language.jpg”):
actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in call' actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:incall’
railties (3.2.8) lib/rails/rack/logger.rb:26:in call_app' railties (3.2.8) lib/rails/rack/logger.rb:16:incall’
actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in call' rack (1.4.1) lib/rack/methodoverride.rb:21:incall’
rack (1.4.1) lib/rack/runtime.rb:17:in call' activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:incall’
rack (1.4.1) lib/rack/lock.rb:15:in call' actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:incall’
railties (3.2.8) lib/rails/engine.rb:479:in call' railties (3.2.8) lib/rails/application.rb:223:incall’
railties (3.2.8) lib/rails/railtie/configurable.rb:30:in method_missing' thin (1.5.0) lib/thin/connection.rb:81:inblock in pre_process’
thin (1.5.0) lib/thin/connection.rb:79:in catch' thin (1.5.0) lib/thin/connection.rb:79:inpre_process’
thin (1.5.0) lib/thin/connection.rb:54:in process' thin (1.5.0) lib/thin/connection.rb:39:inreceive_data’
eventmachine (1.0.0) lib/eventmachine.rb:187:in run_machine' eventmachine (1.0.0) lib/eventmachine.rb:187:inrun’
thin (1.5.0) lib/thin/backends/base.rb:63:in start' thin (1.5.0) lib/thin/server.rb:159:instart’
thin (1.5.0) lib/thin/controllers/controller.rb:86:in start' thin (1.5.0) lib/thin/runner.rb:187:inrun_command’
thin (1.5.0) lib/thin/runner.rb:152:in run!' thin (1.5.0) bin/thin:6:in<top (required)>’
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/thin:23:in load' /usr/local/rvm/gems/ruby-1.9.3-p194/bin/thin:23:in

Rendered /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.2ms)

Started GET “/assets/wall/1/thumb/bg_wo_video_language.jpg” for 89.79.218.16 at 2012-11-29 14:35:08 +0100
Served asset /wall/1/thumb/bg_wo_video_language.jpg - 404 Not Found (10ms)

ActionController::RoutingError (No route matches [GET] “/assets/wall/1/thumb/bg_wo_video_language.jpg”):
actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in call' actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:incall’
railties (3.2.8) lib/rails/rack/logger.rb:26:in call_app' railties (3.2.8) lib/rails/rack/logger.rb:16:incall’
actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in call' rack (1.4.1) lib/rack/methodoverride.rb:21:incall’
rack (1.4.1) lib/rack/runtime.rb:17:in call' activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:incall’
rack (1.4.1) lib/rack/lock.rb:15:in call' actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:incall’
railties (3.2.8) lib/rails/engine.rb:479:in call' railties (3.2.8) lib/rails/application.rb:223:incall’
railties (3.2.8) lib/rails/railtie/configurable.rb:30:in method_missing' thin (1.5.0) lib/thin/connection.rb:81:inblock in pre_process’
thin (1.5.0) lib/thin/connection.rb:79:in catch' thin (1.5.0) lib/thin/connection.rb:79:inpre_process’
thin (1.5.0) lib/thin/connection.rb:54:in process' thin (1.5.0) lib/thin/connection.rb:39:inreceive_data’
eventmachine (1.0.0) lib/eventmachine.rb:187:in run_machine' eventmachine (1.0.0) lib/eventmachine.rb:187:inrun’
thin (1.5.0) lib/thin/backends/base.rb:63:in start' thin (1.5.0) lib/thin/server.rb:159:instart’
thin (1.5.0) lib/thin/controllers/controller.rb:86:in start' thin (1.5.0) lib/thin/runner.rb:187:inrun_command’
thin (1.5.0) lib/thin/runner.rb:152:in run!' thin (1.5.0) bin/thin:6:in<top (required)>’
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/thin:23:in load' /usr/local/rvm/gems/ruby-1.9.3-p194/bin/thin:23:in'[/code]
Jak tylko wywalę “:styles => { :small => “150x150>” },” to działał… no ale miniaturek nie robi.

Może ktoś coś podpowie.

Zostaw public/assets w spokoju, tam powinny być kompilowane assety i do nich prowadzą railsowe helpery assetowe jak image_path (etc.). Paperclip domyślnie kieruje swoje pliki do public/system i tam polecam. Zresztą spróbuj wywalić cały argument :path i pojedź na difoltach.

tak też nie działa a z asset to tak mi się skopiowało… gdzieś w railscast tak było więc już próbowałem na tamtym kodzie…

ogólnie to pierwotnie miałem tak:

has_attached_file :images, :styles => { :small => "150x150>" }

no ale nie działa. jak wywalę :styles to działa.

“nie działa” w sensie sypie się upload czy samo oglądanie? Nie mam szklanej kuli do wróżenia, potrzeba danych.

formularz się odświeża(wygląda tak jak powinno) i nie ma w ogóle błędów.

U mnie dziala cos takiego:

has_attached_file :asset,
    :styles => {
      :thumb=> "100x100>",
      :small  => "300x300>",
      :large => "600x600>"
        }
 
    validates_attachment_size :asset, :less_than => 5.megabytes  
    validates_attachment_content_type :asset, :content_type => ['image/jpeg', 'image/png']  
end

Moze jest jakis problem z prawami dostepu do katalogu a co jak zostawisz domyslne sciezki a tamte usuniesz?