Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errno::ENOENT: No such file or directory - local.path #23

Open
jwoertink opened this issue Jan 30, 2013 · 4 comments
Open

Errno::ENOENT: No such file or directory - local.path #23

jwoertink opened this issue Jan 30, 2013 · 4 comments
Milestone

Comments

@jwoertink
Copy link

I'm using Faraday which requires this gem as a dependency. When I try this code in the rails console

conn = Faraday.new('http://localhost:3000') do |far|
  far.request :multipart
  far.request :url_encoded
end
params = {}
params[:user] = {:avatar => Faraday::UploadIO.new('sample.jpg', 'image/jpeg') }
response = conn.put('/users', params)

I get the following error:

Errno::ENOENT: No such file or directory - local.path
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/multipart-post-1.1.5/lib/parts.rb:51:in `size'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/multipart-post-1.1.5/lib/parts.rb:51:in `initialize'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/multipart-post-1.1.5/lib/parts.rb:11:in `new'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/multipart-post-1.1.5/lib/parts.rb:11:in `new'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:37:in `block in create_multipart'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:57:in `call'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:57:in `block in process_params'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:47:in `each'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:47:in `inject'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:47:in `process_params'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:55:in `block in process_params'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:47:in `each'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:47:in `inject'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:47:in `process_params'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:36:in `create_multipart'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:11:in `block in call'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/url_encoded.rb:20:in `match_content_type'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/request/multipart.rb:7:in `call'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/connection.rb:226:in `run_request'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/faraday-0.8.4/lib/faraday/connection.rb:99:in `put'
    from (irb):60                               
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start'
    from /Users/jeremy/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'1.9.3p362 :061 >

Using version 1.1.5

@ioquatix
Copy link
Member

ioquatix commented May 3, 2017

Is this still an issue on ruby 2.0+ ?

@ioquatix ioquatix added this to the 3.0 milestone May 3, 2017
@jwoertink
Copy link
Author

lol. I don't even remember posting this issue. The app I was using this for doesn't even exist 😂

@ioquatix
Copy link
Member

ioquatix commented May 3, 2017

@jwoertink It's okay, even though the issue is old, it's never been triaged, so I'm just going through all issues to try and at least get a handle on what the status is currently.

@kawashinji
Copy link

I occurred the same issue. I resolved it as below.

File.open('sample.jpg') do |file|
  params = {}
  params[:user] = {:avatar => UploadIO.new(file, 'image/jpeg', 'filename.jpg') }
  response = conn.put('/users', params)
end

faraday v0.17.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants