raulanatol / el_finder_s3

Ruby gem to provide server side connector to elFinder using AWS S3 like a container
MIT License
1 stars 7 forks source link

NoMethodError (undefined method `exist?' for #<ElFinderS3::DummyCacheClient:0x0000000a0c7f10>) #1

Closed Ranjithkumar closed 8 years ago

Ranjithkumar commented 8 years ago

Getting this error

NoMethodError (undefined method exist?' for #<ElFinderS3::DummyCacheClient:0x0000000a0c7f10>): vendor/gems/el_finder_s3/lib/el_finder_s3/cache_connector.rb:17:incached' vendor/gems/el_finder_s3/lib/el_finder_s3/adapter.rb:50:in exist?' vendor/gems/el_finder_s3/lib/el_finder_s3/s3_pathname.rb:62:inexist?' vendor/gems/el_finder_s3/lib/el_finder_s3/pathname.rb:70:in exist?' vendor/gems/el_finder_s3/lib/el_finder_s3/connector.rb:94:inrun'

Any idea?

raulanatol commented 8 years ago

Hi @Ranjithkumar

I've pushed a new gem version. Please try to test with this version (0.1.2)

Regards

Ranjithkumar commented 8 years ago

Hi Raul,

I have updated the gem version. But Same issue again.

This is what i am trying,

ElFinderS3::Connector.new( :mime_handler => ElFinderS3::MimeType, :root => '/uploads', :url => 'CDN_BASE_PATH' :thumbs => true, :thumbs_size => 100, :thumbs_directory => 'thumbs', :home => t('admin.media.home'), :original_filename_method => lambda { |file| "#{File.basename(file.original_filename, File.extname(file.original_filename)).parameterize}#{File.extname(file.original_filename)}" }, :default_perms => {:read => true, :write => true, :rm => true, :hidden => false}, :server => { :bucket_name => 'BUCKET_NAME', :region => 'AWS_REGION', :access_key_id => 'ACCESS_KEY_ID', :secret_access_key => 'SECRET_ACCESS_KEY' } ).run(params)

Thanks Ranjith

raulanatol commented 8 years ago

Hi @Ranjithkumar,

You are using the no-cache configuration. Sorry but this configuration has an error. I've created the exist? method to this configuration.

Regards.

Ranjithkumar commented 8 years ago

Hi Raul,

I too did the same.... After adding exist? method in DummyCacheClient, it is working fine.

Thanks for the support Raul.

Is it possible to change/switch the root directory? I mean, this is my directory structure BUCKET_NAME/uploads/dev

How to give root directory as "dev"?

Thanks Ranjith

raulanatol commented 8 years ago

Hi @Ranjithkumar

Try to change the connector new:

ElFinderS3::Connector.new(
...
:root => '/uploads/dev',
...

Regards.

Ranjithkumar commented 8 years ago

Hi Raul,

I have tried it already. But no luck. It was displaying all folders from "/uploads" not from "/uploads/dev". Any idea?

Thanks Ranjith

raulanatol commented 8 years ago

H @Ranjithkumar

In this line: https://github.com/raulanatol/el_finder_s3/blob/29c3fa842fb498b7f003bfc39f991ce0ae3de448/lib/el_finder_s3/pathname.rb#L13 gets the root path.

Could you see what value are you taking?

Sorry but I don't have a test application to verify it. Could you upload a test demo app?

Regards.

Ranjithkumar commented 8 years ago

Hi Raul,

Problem in the root path. Its working now.

Thanks, Ranjith

raulanatol commented 8 years ago

Good news @Ranjithkumar. Your welcome.

Please if you change anything please make a PR.

Ranjithkumar commented 8 years ago

Hi Raul,

How to download file from s3? what is the connector option & syntax?

Thanks Ranjith

raulanatol commented 8 years ago

Hi @Ranjithkumar Sorry for the delay.

Currently we have not implemented this feature.

Regards.