# Getcwd not found: rails 1.1.6, file\_column (svn)

**URL:** <https://www.ruby-forum.com/t/getcwd-not-found-rails-1-1-6-file-column-svn/106830>\
**Category:** Rails\
**Created:** [June 14, 2007, 1:39pm UTC](https://www.ruby-forum.com/t/getcwd-not-found-rails-1-1-6-file-column-svn/106830 "2007-06-14T13:39:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/43a26b/32.png) [@nov](https://www.ruby-forum.com/u/nov)\
**Post date:** [June 14, 2007, 1:39pm UTC](https://www.ruby-forum.com/t/getcwd-not-found-rails-1-1-6-file-column-svn/106830/1 "2007-06-14T13:39:16Z")

</div>

Hi,

I get an “Errno::ENOENT No such file or directory - getcwd”, after  
finishing an upload process by the file\_column plugin, and just before  
a redirection.

The action which receives the POST with the upload information is

def presentation  
(…)  
save\_file(@presentation, params[:presentation])  
(…)  
redirect\_to :action =\> ‘admin’  
end

If I comment the save\_file statement, redirect\_to works, and no file  
is uploaded, as expected. If I leave it uncommented, that’s what it is  
supposed to do:

def save\_file(array, parameters)  
if array.update\_attributes(parameters)  
name = File.basename(array.file)  
name.gsub(/[^\w.\_-]/,’’)  
array.name = name  
if array.save  
else  
flash[:notice] = “Error: array.save”  
return false  
end  
else  
flash[:notice] = “Error: array.update\_attributes”  
return false  
end  
return true  
end

What it happens, instead, is: the file is uploaded, the database is  
filled, but something goes wrong as the ENOENT error message appears  
before the redirection is completed. I must restart lighttpd to reach  
again the app.

It’s really a weird problem. I have another file upload field under  
the same controller and it just works fine…

The exception, exactly, claims:

Errno::ENOENT  
No such file or directory - getcwd  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/  
action\_controller/routing.rb:269:in `expand_path' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/ action_controller/routing.rb:269:in`safe\_load\_paths’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/  
action\_controller/routing.rb:268:in `select' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/ action_controller/routing.rb:268:in`safe\_load\_paths’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/  
action\_controller/routing.rb:281:in `attempt_load' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/ action_controller/routing.rb:237:in`traverse\_to\_controller’  
generated/routing/recognition.rb:3:in `recognize_path' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/ action_controller/routing.rb:511:in`recognize!’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in  
`dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb: 150:in`process\_request’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi\_handler.rb:  
54:in `process!' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in`each\_cgi’  
/usr/local/lib/ruby/site\_ruby/1.8/fcgi.rb:117:in `session' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:104:in`each\_request’  
/usr/local/lib/ruby/site\_ruby/1.8/fcgi.rb:36:in `each' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in`each\_cgi’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi\_handler.rb:  
53:in `process!' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb: 23:in`process!’

I don’t know if it has to do with the safe\_load\_paths in routing.rb of  
actionpack-1.12.5… if I should then upgrade to 1.2.3 of if there’s  
something I’m missing.

I’ve someone has encountered something similar, any help or insight is  
much appreciated.

Thank you,  
abelardo
