Problem with root

30 views
Skip to first unread message

Francisco Bereciartu

unread,
Nov 24, 2014, 1:13:09 PM11/24/14
to rubyonra...@googlegroups.com
Hi All,

I'm new in the ruby on rails world. I would like to ask you about any
advice according to this problem

I'm having problems with redirection, I have this line in the routes.rb

root :to => 'welcome#index', :as => 'home'


in the app/controllers folder I have welcome_controller.rb

and in the views/welcome/index.html.erb file

but when I use http://my.domain.com/

I have the 404 page.

but if I use http://my.domain.com/login, it does work.

Thanks

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

Jason Fleetwood-Boldt

unread,
Nov 24, 2014, 1:15:57 PM11/24/14
to rubyonra...@googlegroups.com

show us what happens when you run 

tail -f log/development.log 

in a console window while you hit the page in your browser






On Nov 24, 2014, at 1:10 PM, Francisco Bereciartu <li...@ruby-forum.com> wrote:

Hi All,

I'm new in the ruby on rails world. I would like to ask you about any
advice according to this problem

I'm having problems with redirection, I have this line in the routes.rb

root :to => 'welcome#index', :as => 'home'


in the app/controllers folder I have welcome_controller.rb

and in the views/welcome/index.html.erb file

but when I use http://my.domain.com/

I have the 404 page.

but if I use http://my.domain.com/login, it does work.

----

Jason Fleetwood-Boldt
te...@datatravels.com
http://www.jasonfleetwoodboldt.com/writing

All material © Jason Fleetwood-Boldt 2014. Public conversations may be turned into blog posts (original poster information will be made anonymous). Email ja...@datatravels.com with questions/concerns about this.

Francisco Bereciartu

unread,
Nov 24, 2014, 1:26:57 PM11/24/14
to rubyonra...@googlegroups.com
Hi Jason,

using this tail -f log/development.log, and then requesting the domain,
it does not show anything, but in the log of the site it does have these
messages:


Started GET "/index.html" for 192.222.129.185 at 2014-11-24 12:47:46
-0500

ActionController::RoutingError (No route matches [GET] "/index.html"):
actionpack (3.2.19)
lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.19)
lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.19) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.19) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.19) lib/active_support/tagged_logging.rb:22:in
`tagged'
railties (3.2.19) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.19) lib/action_dispatch/middleware/request_id.rb:22:in
`call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.19)
lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.19) lib/action_dispatch/middleware/static.rb:63:in
`call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.2.19) lib/rails/engine.rb:484:in `call'
railties (3.2.19) lib/rails/application.rb:231:in `call'
railties (3.2.19) lib/rails/railtie/configurable.rb:30:in
`method_missing'
passenger (4.0.53)
lib/phusion_passenger/rack/thread_handler_extension.rb:74:in
`process_request'
passenger (4.0.53)
lib/phusion_passenger/request_handler/thread_handler.rb:141:in
`accept_and_process_next_request'
passenger (4.0.53)
lib/phusion_passenger/request_handler/thread_handler.rb:109:in
`main_loop'
passenger (4.0.53) lib/phusion_passenger/request_handler.rb:455:in
`block (3 levels) in start_threads'


Jason Fb wrote in post #1163214:
> show us what happens when you run
>
> tail -f log/development.log
>
> in a console window while you hit the page in your browser
>
>
>
>
>
>
>>
>>
>> in the app/controllers folder I have welcome_controller.rb
>>
>> and in the views/welcome/index.html.erb file
>>
>> but when I use http://my.domain.com/
>>
>> I have the 404 page.
>>
>> but if I use http://my.domain.com/login, it does work.
>
> ----
>
> Jason Fleetwood-Boldt
> te...@datatravels.com
> http://www.jasonfleetwoodboldt.com/writing
>
> All material © Jason Fleetwood-Boldt 2014. Public conversations may be
> turned into blog posts (original poster information will be made
> anonymous). Email ja...@datatravels.com with questions/concerns about
> this.

Walter Lee Davis

unread,
Nov 24, 2014, 1:37:51 PM11/24/14
to rubyonra...@googlegroups.com
What does the Apache conf file look like for this host? Apache is trying to tack an auto-index on this page, which is messing with the route passed in from Passenger.

Here's a snippet from one of mine -- note the -Indexes directive. Does yours have that?

<Directory /data/www/example.com/public>
Options -Indexes FollowSymLinks -MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

Walter
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b2c643f025271b059eff6b24705f15ae%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

Francisco Bereciartu

unread,
Nov 24, 2014, 1:47:02 PM11/24/14
to rubyonra...@googlegroups.com
Hi Walter this is mine:

<VirtualHost *:80>
ServerName my.domain.com
DocumentRoot /var/www/
ErrorLog logs/redmine_error_log

<Directory "/var/www/redmine/public/">
Options -MultiViews Indexes ExecCGI FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all
</Directory>
</VirtualHost>

if I set -Indexes, the site does not work at all.


Walter Davis wrote in post #1163219:
> What does the Apache conf file look like for this host? Apache is trying
> to tack an auto-index on this page, which is messing with the route
> passed in from Passenger.
>
> Here's a snippet from one of mine -- note the -Indexes directive. Does
> yours have that?
>
> <Directory /data/www/example.com/public>
> Options -Indexes FollowSymLinks -MultiViews
> AllowOverride All
> Order allow,deny
> allow from all
> </Directory>
>
> Walter

Francisco Bereciartu

unread,
Nov 24, 2014, 2:12:01 PM11/24/14
to rubyonra...@googlegroups.com
I got the solution of the problem,

in the .htaccess file I had this rule

RewriteRule ^$ index.html [QSA]

I comment it and now it works like a charm.

Thank you!


Francisco Bereciartu wrote in post #1163221:
Reply all
Reply to author
Forward
0 new messages