per una nuova app Voglio utilizzare la graffetta per archiviare i file su S3. Ho già installato la gemma aws-s3 per un'altra app. Ciò sembra causare alcuni problemi, perché Paperclip dovrebbe usare right_aws ma sta cercando di usare la gemma aws-s3. Ma non voglio rimuovere la gemma aws-s3 dal mio sistema. C'è un modo per risolvere questo conflitto? Forse forzando la paperclip a usare right_aws? O modificando la configurazione?Rails Conflitto di graffette tra gemma aws-s3 e gemma right_aws. Come risolvere?
La mia configurazione
# enviroment.rb
config.gem 'right_aws'
# my model with the attachment
has_attached_file :thumbnail,
:styles => { :thumb => "160x120>" },
:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/amazons3.yml",
:path => ":provider/:attachment/:id_:style.:extension"
# config/amazons3.yml
development:
bucket: bucketname
access_key_id: secret
secret_access_key: secret
test:
bucket: bucketname
access_key_id: secret
secret_access_key: secret
production:
bucket: bucketname
access_key_id: secret
secret_access_key: secret
# The Error in the console
ArgumentError: wrong number of arguments (5 for 4)
from /Library/Ruby/Gems/1.8/gems/right_http_connection-1.2.4/lib/net_fix.rb:85:in `send_request_with_body_stream'
from /Library/Ruby/Gems/1.8/gems/right_http_connection-1.2.4/lib/net_fix.rb:85:in `exec'
from /Library/Ruby/Gems/1.8/gems/right_http_connection-1.2.4/lib/net_fix.rb:144:in `request'
from /Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/connection.rb:45:in `request'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:543:in `start'
from /Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/connection.rb:52:in `request'
from /Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:69:in `request'
from /Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:88:in `put'
from /Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/object.rb:241:in `store'
...
Grazie!
Il modulo richiede Paperclip, che sembra provare a utilizzare aws-s3. Come posso risolverlo? – Cristian
Cristian, mi scusi per la risposta così lunga. Paperclip richiede 'aws-s3' solo per lo sviluppo, non per il runtime.Quando usi 'paperclip-aws ', dovresti includere nel tuo Gemfile, come mostrato nella documentazione e poi in bundle. Niente di più è necessario. –
Grazie. Ho già risolto questo usando il tuo gioiello :) – Cristian