Problem with controllers

Hi all,

I have setup a ROR environment on my server and once i generate a
controller with a few actions in it and put a basic message in each
action within the controller rb file also editing the views for these
actions all i get is the standard 404 not found. I can not understand
why this is.

p.s all the routes are pointing to the controller and actions i created
as well

Any ideas

Thanks

I am using REE too if thats helps, as when starting webrick i get can’t
connect to mysql so its bit more than the other one, like i said
REE and apache 2.

Thanks

On Apr 7, 2012, at 11:36 AM, Paul Na wrote:

Hi all,

I have setup a ROR environment on my server and once i generate a
controller with a few actions in it and put a basic message in each
action within the controller rb file also editing the views for these
actions all i get is the standard 404 not found. I can not understand
why this is.

Any ideas

Have you edited your routes.rb file to reflect this new controller? The
default since quite a while now has been for there to not be a
“catch-all” route that would attempt to handle anything that didn’t have
an explicit declaration. You may need to add a line like this:

resources :modelname

if you have all of the basic 7 REST routes covered, or another route
that more explicitly lays out the controller methods you want to expose.

Walter

On 7 April 2012 16:52, Paul Na [email protected] wrote:

I am use REE too if thats helps, as when starting webrick i get can’t
connect to mysql so its bit more than the other with is on like i said
REE and apache 2.

Post the full error message. We are not telepathic. At least I am
not. Copy and paste it, do not retype it.

Also are you able to access the database from mysql command line or GUI?

Also tell us which operating system you are using and which version of
Rails.

Colin

Sorry i didn’t load the passenger module into apache wooops, but now
i’m getting
a message:

We’re sorry, but something went wrong.

Hi colin,

Theres no log/development.log ? and i can’t find the log anywhere, i
even tried the apache log but nothing in there either :frowning:

Thanks

On 7 April 2012 17:25, Paul Na [email protected] wrote:

Sorry i didn’t load the passenger module it wooops, but now i’m getting
a message:

We’re sorry, but something went wrong.

Look in log/development.log or/and in the server terminal window,
there should be more info there.

Colin

Right i have changed the permission of the whole app folder to
apache:apache and the message has gone but has not render the html.erb
file :S

Its works fine with webrick but not passenger/apache

here is the passenger log and the error is shown as access front/home:

file=ext/common/ApplicationPool/…/SpawnManager.h:410 time=2012-04-07
21:50:36.317 ]: Application process 2295 spawned
[ pid=2258 thr=140485319882496 file=ext/common/Process.h:116
time=2012-04-07 21:50:36.317 ]: Application process 2295
(0x7fc538002a80): created.
[ pid=2270 thr=140125444347872 file=ext/apache2/Hooks.cpp:666
time=2012-04-07 21:50:36.318 ]: Forwarding /front/home to PID 2295
[ pid=2295 thr=11469100 file=abstract_request_handler.rb:244
time=2012-04-07 21:50:36.523 ]: Entering request handler main loop
[ pid=2295 thr=11469100 file=abstract_request_handler.rb:466
time=2012-04-07 21:50:36.524 ]: Accepting new request on main socket
[ pid=2263 thr=140119827085280
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2012-04-07
21:50:38.926 ]: Flushing all sinks (periodic action)
[ pid=2263 thr=140119827085280
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2012-04-07
21:50:53.926 ]: Flushing all sinks (periodic action)
[ pid=2292 thr=140125444347872 file=ext/apache2/Hooks.cpp:666
time=2012-04-07 21:51:04.611 ]: Forwarding /front/home to PID 2295
[ pid=2295 thr=11469100 file=abstract_request_handler.rb:466
time=2012-04-07 21:51:04.611 ]: Accepting new request on main socket
[ pid=2263 thr=140119827085280
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2012-04-07
21:51:08.926 ]: Flushing all sinks (periodic action)
[ pid=2270 thr=140125444347872 file=ext/apache2/Hooks.cpp:666
time=2012-04-07 21:51:18.417 ]: Forwarding /front/home to PID 2295
[ pid=2295 thr=11469100 file=abstract_request_handler.rb:466
time=2012-04-07 21:51:18.417 ]: Accepting new request on main socket
[ pid=2263 thr=140119827085280
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2012-04-07
21:51:23.926 ]: Flushing all sinks (periodic action)
[ pid=2292 thr=140125444347872 file=ext/apache2/Hooks.cpp:666
time=2012-04-07 21:51:27.702 ]: Forwarding /front/home to PID 2295
[ pid=2295 thr=11469100 file=abstract_request_handler.rb:466
time=2012-04-07 21:51:27.703 ]: Accepting new request on main socket
[ pid=2263 thr=140119827085280
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2012-04-07
21:51:38.926 ]: Flushing all sinks (periodic action)
[ pid=2263 thr=140119827085280
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2012-04-07
21:51:53.926 ]: Flushing all sinks (periodic action)
[ pid=2270 thr=140125444347872 file=ext/apache2/Hooks.cpp:666
time=2012-04-07 21:51:55.364 ]: Forwarding /front/home to PID 2295
[ pid=2295 thr=11469100 file=abstract_request_handler.rb:466
time=2012-04-07 21:51:55.364 ]: Accepting new request on main socket
[ pid=2263 thr=140119827085280
file=ext/common/LoggingAgent/LoggingServer.h:829 time=2012-04-07
21:52:08.926 ]: Flushing all sinks (periodic action)

Thanks

OK problem has been fixed by setting RailsEnv to development and it
works, but setting it to production message comes back so it looks like
passenger run it default in production mode so i don’t know why this is.

The apache access log says :

[07/Apr/2012:22:04:38 +0400] “GET /front/home HTTP/1.1” 500 643 ; when
the message show

[07/Apr/2012:22:04:38 +0400] “GET /front/home HTTP/1.1” 500 - ; when the
message don’t show due to changing the permission.

passenger always runs in production mode if not specified else

<VirtualHost *>
ServerName example.com
DocumentRoot /app/public
RailsEnv development

tom

On Apr 7, 2012, at 21:24 , Paul Na wrote:

To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz

Oh ok, so are there other option need to be set for the production env
to stop the “We’re sorry, but something went wrong.” message

On Apr 7, 2012, at 21:34 , Paul Na wrote:

Oh ok, so are there other option need to be set for the production env
to stop the “We’re sorry, but something went wrong.” message

“We’re sorry, but something went wrong.” message says there’s something
wrong in your code/setup. You have to check your log in log/ directory
(either production/development.log)

tom


Posted via http://www.ruby-forum.com/.


You received this message because you are subscribed to the Google G. “Ruby
on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz

On 7 April 2012 21:33, Paul Na [email protected] wrote:

how comes it works in the development as its the same app?

Look in production.log and you may find out. There is no way anyone
here can know the answer. There are innumerable possibilities from
forgetting to create the production database to subtle page caching
problems.

Colin

how comes it works in the development as its the same app?

I have sorted it, it was due to the application.css not being compiled

Thanks for your help