Ruby on Rails 2.0.2 error

Hello, folks! I'm playing with rails in my debian lenny system, and I'm facing some unsolvable difficulties now.

I've successfully installed rails, lighttpd and mysql from aptitude. Configuration took some time, but wasn't the real pain. And finally I visit my 'http://localhost'. Everything seemed to work properly. Introduction page was OK, 'http://localhost/rails/info/properties’ showed me correct info: <-------- Ruby version 1.8.6 (i486-linux) RubyGems version 1.0.1 Rails version 2.0.2 Active Record version 2.0.2 Action Pack version 2.0.2 Active Resource version 2.0.2 Action Mailer version 2.0.2 Active Support version 2.0.2 Application root /var/www/local Environment development Database adapter mysql Database schema version 1 -------->

But when I tryed to add a simpliest controller, everything broke down. <-------- $ ./script/generate controller My_Test        exists app/controllers/        exists app/helpers/       create app/views/my_test       create test/functional/       create app/controllers/my_test_controller.rb       create test/functional/my_test_controller_test.rb       create app/helpers/my_test_helper.rb --------> So everything should be OK. Test with rake is successful. But any ruby request gives: <-------- MissingSourceFile no such file to load -- /var/www/local/app/helpers/my_test_helper.rb

RAILS_ROOT: /var/www/local Application Trace | Framework Trace | Full Trace

/var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:203:in `load_without_new_constant_marking' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:203:in `load_file' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:342:in `new_constants_in' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:202:in `load_file' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:94:in `require_or_load' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:60:in `depend_on' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:442:in `require_dependency' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ helpers.rb:122:in `helper' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ helpers.rb:111:in `each' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ helpers.rb:111:in `helper' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ helpers.rb:116:in `helper' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ helpers.rb:111:in `each' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ helpers.rb:111:in `helper' app/controllers/application.rb:5 /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:203:in `load_without_new_constant_marking' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:203:in `load_file' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:342:in `new_constants_in' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:202:in `load_file' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:94:in `require_or_load' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:60:in `depend_on' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:442:in `require_dependency' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:101:in `process_request' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:149:in `with_signal_handler' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:99:in `process_request' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:77:in `process_each_request' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:76:in `process_each_request' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:50:in `process!' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:24:in `process!'

/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:141:in `prepare_application' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:178:in `send!' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:178:in `run_callbacks' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:175:in `each' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:175:in `send!' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:175:in `run_callbacks' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:114:in `dispatch' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:126:in `dispatch_cgi' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:9:in `dispatch' /usr/lib/ruby/1.8/fcgi.rb:612:in `each_cgi' /usr/lib/ruby/1.8/fcgi.rb:609:in `each' /usr/lib/ruby/1.8/fcgi.rb:609:in `each_cgi' public/dispatch.fcgi:24

/var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:203:in `load_without_new_constant_marking' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:203:in `load_file' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:342:in `new_constants_in' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:202:in `load_file' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:94:in `require_or_load' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:60:in `depend_on' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:442:in `require_dependency' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ helpers.rb:122:in `helper' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ helpers.rb:111:in `each' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ helpers.rb:111:in `helper' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ helpers.rb:116:in `helper' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ helpers.rb:111:in `each' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ helpers.rb:111:in `helper' app/controllers/application.rb:5 /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:203:in `load_without_new_constant_marking' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:203:in `load_file' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:342:in `new_constants_in' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:202:in `load_file' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:94:in `require_or_load' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:60:in `depend_on' /var/lib/gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:442:in `require_dependency' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:141:in `prepare_application' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:178:in `send!' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:178:in `run_callbacks' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:175:in `each' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:175:in `send!' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:175:in `run_callbacks' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:114:in `dispatch' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:126:in `dispatch_cgi' /var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/ dispatcher.rb:9:in `dispatch' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:101:in `process_request' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:149:in `with_signal_handler' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:99:in `process_request' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:77:in `process_each_request' /usr/lib/ruby/1.8/fcgi.rb:612:in `each_cgi' /usr/lib/ruby/1.8/fcgi.rb:609:in `each' /usr/lib/ruby/1.8/fcgi.rb:609:in `each_cgi' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:76:in `process_each_request' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:50:in `process!' /var/lib/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:24:in `process!' public/dispatch.fcgi:24

Request

Parameters:

None

Show session dump

Hello, folks! I'm playing with rails in my debian lenny system, and I'm facing some unsolvable difficulties now.

I've successfully installed rails, lighttpd and mysql from aptitude. Configuration took some time, but wasn't the real pain. And finally I visit my 'http://localhost'. Everything seemed to work properly. Introduction page was OK, 'http://localhost/rails/info/properties’ showed me correct info: <-------- Ruby version 1.8.6 (i486-linux) RubyGems version 1.0.1 Rails version 2.0.2 Active Record version 2.0.2 Action Pack version 2.0.2 Active Resource version 2.0.2 Action Mailer version 2.0.2 Active Support version 2.0.2 Application root /var/www/local Environment development Database adapter mysql Database schema version 1 -------->

But when I tryed to add a simpliest controller, everything broke down. <-------- $ ./script/generate controller My_Test       exists app/controllers/       exists app/helpers/      create app/views/my_test      create test/functional/      create app/controllers/my_test_controller.rb      create test/functional/my_test_controller_test.rb      create app/helpers/my_test_helper.rb -------->

does it work if you say ./script/generate controller my_test

Fred

<-------- $ ./script/generate controller my_test       exists app/controllers/       exists app/helpers/       create app/views/my_test       create test/functional/       create app/controllers/my_test_controller.rb       create test/functional/my_test_controller_test.rb       create app/helpers/my_test_helper.rb --------> rake says OK. The same error is there.

no such file to load -- /var/www/local/app/helpers/my_test_helper.rb And so on

<-------- $ ./script/generate controller my_test      exists app/controllers/      exists app/helpers/      create app/views/my_test      create test/functional/      create app/controllers/my_test_controller.rb      create test/functional/my_test_controller_test.rb      create app/helpers/my_test_helper.rb --------> rake says OK. The same error is there.

no such file to load -- /var/www/local/app/helpers/my_test_helper.rb

has it done something silly like create the file with the wrong permissions, owner, something else ?

Fred

<-------- $ ./script/generate controller my_test     exists app/controllers/     exists app/helpers/     create app/views/my_test     create test/functional/     create app/controllers/my_test_controller.rb     create test/functional/my_test_controller_test.rb     create app/helpers/my_test_helper.rb --------> rake says OK. The same error is there.

no such file to load -- /var/www/local/app/helpers/my_test_helper.rb

has it done something silly like create the file with the wrong permissions, owner, something else ?

To add to that, since you seem to be using fastcgi, the file needs to be readable by whatever user apache is running as.

Oh, I'm really ashamed.

$chown -R kirushik:www-data /var/www/local and $chmod -R 775 /var/www/local solved the issue.

Thank you, Frederick.

And one more question - how can I configure script/generate to force it to set those permissions automatically each time?

Oh, I'm really ashamed.

$chown -R kirushik:www-data /var/www/local and $chmod -R 775 /var/www/local solved the issue.

Thank you, Frederick.

And one more question - how can I configure script/generate to force it to set those permissions automatically each time?

Sorry, no idea. Can you fiddle around with the umask ?