2013-07-19 5 views
3

Michael Hartl 's rails 튜토리얼을 따르고 있습니다. 모든 것이 잘 작동하지만 실행할 때 나는 다음과 같은 오류가 명령 줄에 "서버를 레일"하였다 레일 서버를 실행할 때 오류가 발생했습니다

=> Booting WEBrick 
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000 
=> Call with -d to detach 
=> Ctrl-C to shutdown server 
Exiting 
/home/jonathan/.rvm/gems/[email protected]/gems/actionpack- 3.2.13/lib/action_dispatch/routing/mapper.rb:254:in `merge': can't convert String into Hash (TypeError) 
from /home/jonathan/.rvm/gems/[email protected]/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:254:in `root' 
from /home/jonathan/.rvm/gems/[email protected]/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1321:in `root' 
from /home/jonathan/Desktop/railsTut/sample_app/config/routes.rb:4:in `block in <top (required)>' 
from /home/jonathan/.rvm/gems/[email protected]/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:289:in `instance_exec' 
from /home/jonathan/.rvm/gems/[email protected]/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:289:in `eval_block' 
from /home/jonathan/.rvm/gems/[email protected]/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:267:in `draw' 
from /home/jonathan/Desktop/railsTut/sample_app/config/routes.rb:1:in `<top (required)>' 
. 
. 
. 

가 여기에 어떤 도움에 감사드립니다

SampleApp::Application.routes.draw do 
    resources :users 
    resources :sessions, only: [:new, :create, :destroy] 
    root 'static_pages#home' 
    match '/signup', to: 'users#new',   via: 'get' 
    match '/signin', to: 'sessions#new',   via: 'get' 
    match '/signout', to: 'sessions#destroy',  via: 'delete' 
    match '/help', to: 'static_pages#help' 
    match '/about', to: 'static_pages#about' 
    match '/contact', to: 'static_pages#contact' 

end 

내 routes.rb 파일입니다. 당신의 라인에서

+0

당신이 볼 수 있듯이, 오류 포인트를 당신의'설정/routes.rb' 파일의 네 번째 줄에. 'routes.rb' 파일의 내용을 보여주지 않으면 우리는 도울 수 없습니다. –

+0

죄송합니다 - 방금 게시했습니다 – user2551533

답변

3

routes.rb의 4 당신은이 있어야합니다

root to: 'static_pages#home' 

오류가 발생하기 때문에 당신이 hereroot 방법은 당신이 String을 통과하는 동안 그 매개 변수 Hash 될 것으로 기대 볼 수있다.

+3

'root 'static_pages # home'은 Rails 4에서는 괜찮지 만 Rails 3.2에서는 괜찮은 것 같습니다. – Mischa

+0

저장된 나의 인생 .. :-) –

3

이 시도 :

root to: 'static_pages#home' 
관련 문제