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:inload_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:inload_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:independ_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:inhelper’
/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:inhelper’
/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:ineach’
/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:inload_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:innew_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:inrequire_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:inrequire_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:inwith_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:inprocess_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:inprocess!’
/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:insend!’
/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:ineach’
/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:inrun_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:indispatch_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:ineach_cgi’
/usr/lib/ruby/1.8/fcgi.rb:609:in each' /usr/lib/ruby/1.8/fcgi.rb:609:ineach_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:inload_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:inload_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:independ_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:inhelper’
/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:inhelper’
/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:ineach’
/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:inload_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:innew_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:inrequire_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:inrequire_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:insend!’
/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:ineach’
/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:inrun_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:indispatch_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:inprocess_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:inprocess_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:ineach_cgi’
/usr/lib/ruby/1.8/fcgi.rb:609:in each' /usr/lib/ruby/1.8/fcgi.rb:609:ineach_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:inprocess!’
/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


flash: !map:ActionController::Flash::FlashHash {}

Response

Headers:

{“cookie”=>[],
“Cache-Control”=>“no-cache”}
--------->
That is response to every request involving “public/dispatch.fcgi”,
even the same ‘http://localhost/rails/info/properties’ attempt. The
file ‘/var/www/local/app/helpers/my_test_helper.rb’ is actually in
place and contains empty method MyTestHelper:
<-------
module MyTestHelper
end
-------->
After deletion of controller, everything works again:
<--------
$ ./script/destroy controller My_Test
rm app/helpers/my_test_helper.rb
rm test/functional/my_test_controller_test.rb
rm app/controllers/my_test_controller.rb
rmdir test/functional
notempty test
rmdir app/views/my_test
notempty app/views
notempty app
notempty app/helpers
notempty app
notempty app/controllers
notempty app
--------->

How could I tame this error?
Appreciate your help in advance, Kirill.

On 23 Jan 2008, at 11:29, Kirushik wrote:

<--------
Database adapter mysql
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

On 24 Jan 2008, at 21:23, Kirushik wrote:

-------->
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

On 25 Jan 2008, at 00:38, Frederick C. wrote:

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.

On 25 Jan 2008, at 10:04, Kirushik wrote:

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 ?

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?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs