I am getting an application error when I try to use Dir.chdir in a
layout
<% Dir.chdir(‘public’) %>
The complete dump from development.log is listed below.
When I try the same thing in the console, it works fine.
Loading development environment.
Dir.chdir(‘public’)
=> 0
Any ideas on what the problem is, or how to fix it?
Thanks
Output from development.log
Processing LeagueController#index (for 71.74.192.170 at 2007-06-26
22:28:42) [GET]
Session ID: c2618c4e3154c6d62f1c6dd055a9deb1
Parameters: {“action”=>“index”, “controller”=>“league”}
Errno::ENOENT (No such file or directory - script/…/config/…/tmp/
sessions//ruby_sess.6117ae9afe83d621):
/usr/lib/ruby/1.8/pstore.rb:295:in initialize' /usr/lib/ruby/1.8/pstore.rb:295:in
open’
/usr/lib/ruby/1.8/pstore.rb:295:in transaction' /usr/lib/ruby/1.8/cgi/session/pstore.rb:81:in
update’
/usr/lib/ruby/1.8/cgi/session/pstore.rb:88:in close' /usr/lib/ruby/1.8/cgi/session.rb:324:in
close’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/base.rb:1184:in close_session' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/base.rb:1228:in
process_cleanup_without_flash’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/flash.rb:146:in process_cleanup_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/filters.rb:662:in
process_cleanup_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/session_management.rb:124:in
process_cleanup_without_components' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/components.rb:178:in
process_cleanup’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/base.rb:435:in process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/filters.rb:624:in
process_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/session_management.rb:114:in process' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/base.rb:330:in
process’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb: 113:in
handle_dispatch’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:
79:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in
service’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:in
start_thread’
/usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:in
start_thread’
/usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:in
each’
/usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:in
start’
/usr/lib/ruby/1.8/webrick/server.rb:82:in start' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb: 63:in
dispatch’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/
webrick.rb:59
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
require’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/
dependencies.rb:495:in require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ dependencies.rb:342:in
new_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/
dependencies.rb:495:in require' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require’
script/server:3
Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/templates/rescues/layout.rhtml (500 Internal Error)
No such file or directory - script/…/config/…/tmp/sessions//
ruby_sess.6117ae9afe83d621
/usr/lib/ruby/1.8/pstore.rb:295:in initialize' /usr/lib/ruby/1.8/pstore.rb:295:in
open’
/usr/lib/ruby/1.8/pstore.rb:295:in transaction' /usr/lib/ruby/1.8/cgi/session/pstore.rb:81:in
update’
/usr/lib/ruby/1.8/cgi/session/pstore.rb:88:in close' /usr/lib/ruby/1.8/cgi/session.rb:324:in
close’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:1184:in close_session' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ base.rb:1228:in
process_cleanup_without_flash’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
flash.rb:146:in process_cleanup_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ filters.rb:662:in
process_cleanup_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
session_management.rb:124:in process_cleanup_without_components' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ components.rb:178:in
process_cleanup’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
base.rb:435:in process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ filters.rb:624:in
process_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/
session_management.rb:114:in process' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/ base.rb:330:in
process’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:113:in
handle_dispatch’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:79:in
service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in
service’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:in
start_thread’
/usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:in
start_thread’
/usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:in
each’
/usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:in
start’
/usr/lib/ruby/1.8/webrick/server.rb:82:in start' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:63:in
dispatch’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/
webrick.rb:59
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
require’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/
dependencies.rb:495:in require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ dependencies.rb:342:in
new_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/
dependencies.rb:495:in require' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require’
script/server:3