铁路目录不需要铁路

时间:2014-06-20 21:36:08

标签: ruby-on-rails ruby-on-rails-4 actionmailer

当我尝试从rails控制台实例化我的邮件程序时出现错误。它是在默认的邮件程序文件夹中创建的。我已经尝试重新启动应用程序+在那里创建另一个邮件程序,但它似乎并没有找到它。有人有主意吗?感谢

2.0.0-p247 :002 > TesterMailer
NameError: uninitialized constant TesterMailer
    from (irb):2
    from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.3/lib/rails/commands/console.rb:90:in `start'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.3/lib/rails/commands/console.rb:9:in `start'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/railties-4.0.3/lib/rails/commands.rb:62:in `<top (required)>'
    from /var/guestweb/api.jtestingapp.com/bin/rails:8:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@global/bundler/gems/rails-dev-boost-1e0cc0e1a3f6/lib/rails_development_boost/loadable_patch.rb:14:in `load'
    from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from -e:1:in `<main>'

另外,添加  config.autoload_paths + =%W(#{config.root} / app / mailers)到application.rb修复了它,但是它不应该自动加载它吗?

0 个答案:

没有答案