2016-09-29 13 views
0

のための `root_path '私はDeviseの確認可能な電子メールを処理しようとしましたが、今エラーが表示され、変更されません)。未定義のローカル変数またはメソッド#<#<クラス:0xc0d0c44>:0xc0be918>

誰でも私がそれを識別するのを助けることができれば、私はそれを感謝します。

私はちょうどしようとしていた:http://www.bogotobogo.com/RubyOnRails/RubyOnRails_Devise_Authentication_Sending_Confirmation_Email.php

NameErrorを登録番号では、#<#のため

未定義のローカル変数やメソッド `のroot_path」を作成:0xc0be918> もしかして?ビューマークで

font_path、後に登録してみてください:ルートで

<li><%= link_to "Start", root_path %></li> 

Rails.application.routes.draw do 

    devise_for :usuarios, controllers: {registrations: 'registrations', omniauth_callbacks: "omniauth_callbacks"} 

    root 'welcome#index' 
    get "welcome/index" 

    get ':controller(/:action(/:id))(.:format)' 
    post ':controller(/:action(/:id))(.:format)' 

end 

app/views/devise/mailer/confirmation_instructions.html.erb:12:in `_app_views_devise_mailer_confirmation_instructions_html_erb___614633226_' 
app/controllers/registrations_controller.rb:6:in `create' 

すくいルート

       Prefix Verb  URI Pattern        Controller#Action 
       new_usuario_session GET  /usuarios/sign_in(.:format)    devise/sessions#new 
        usuario_session POST  /usuarios/sign_in(.:format)    devise/sessions#create 
      destroy_usuario_session DELETE /usuarios/sign_out(.:format)    devise/sessions#destroy 
        usuario_password POST  /usuarios/password(.:format)    devise/passwords#create 
       new_usuario_password GET  /usuarios/password/new(.:format)   devise/passwords#new 
       edit_usuario_password GET  /usuarios/password/edit(.:format)   devise/passwords#edit 
            PATCH /usuarios/password(.:format)    devise/passwords#update 
            PUT  /usuarios/password(.:format)    devise/passwords#update 
     cancel_usuario_registration GET  /usuarios/cancel(.:format)     registrations#cancel 
       usuario_registration POST  /usuarios(.:format)      registrations#create 
      new_usuario_registration GET  /usuarios/sign_up(.:format)    registrations#new 
      edit_usuario_registration GET  /usuarios/edit(.:format)     registrations#edit 
            PATCH /usuarios(.:format)      registrations#update 
            PUT  /usuarios(.:format)      registrations#update 
            DELETE /usuarios(.:format)      registrations#destroy 
       usuario_confirmation POST  /usuarios/confirmation(.:format)   devise/confirmations#create 
      new_usuario_confirmation GET  /usuarios/confirmation/new(.:format)  devise/confirmations#new 
            GET  /usuarios/confirmation(.:format)   devise/confirmations#show 
usuario_facebook_omniauth_authorize GET|POST /usuarios/auth/facebook(.:format)   omniauth_callbacks#passthru 
usuario_facebook_omniauth_callback GET|POST /usuarios/auth/facebook/callback(.:format) omniauth_callbacks#facebook 
           root GET /          welcome#index 
         welcome_index GET  /welcome/index(.:format)     welcome#index 
            GET  /:controller(/:action(/:id))(.:format)  :controller#:action 
            POST  /:controller(/:action(/:id))(.:format)  :controller#:action 

的環境:

config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } 
    config.action_mailer.perform_deliveries = true 

    config.action_mailer.raise_delivery_errors = true 
    config.action_mailer.delivery_method = :smtp 
    config.action_mailer.smtp_settings = { 
    user_name:  ENV['uclave.cdcht'], 
    password:  ENV[''], 
    domain:   ENV['gmail'], 
    address:  'smtp.gmail.com', 
    port:   '587', 
    authentication: :plain, 
    enable_starttls_auto: true 
    } 

ユーザー= usuarios(スペイン語)

+1

'rake routes'の結果を投稿してください。 –

+0

routes.rb –

+0

@Deepakもありますか?私はその投稿を編集しています。 –

答えて

2

エラーがあなたのメーラーで起こります。メーラーで_pathヘルパーを使用することはできません(「/」のようなURLを生成するため、メールでクリックすると便利ではありません)。

代わりに_urlヘルパーを使用する必要があります。 config.action_mailer.default_url_options = { host: 'example.com' }config/application.rbにする必要があります)を設定している場合、メーラーをroot_urlに変更するだけで十分です。

関連する問題