0

我正在尝试使用 Griddler gem,并在我的 Gemfile 中为“griddler”进行了捆绑安装。在我的 routes.rb 中,我添加了以下行:

mount_griddler ('/email/incoming')

当我尝试运行时rails s,我不断收到错误:

'block in <top (required)>': undefined method 'mount_griddler' for #<ActionDispatch::Routing::Mapper:0x007fa995bba030> (NoMethodError)

我还在 config/initializer/griddler 中创建了一个文件:

   Griddler.configure do |config|
   config.processor_class = EmailProcessor # MyEmailProcessor
   config.to = :token # :full, :email, :hash
   config.reply_delimiter = '-- REPLY ABOVE THIS LINE --'
   config.email_service = :sendgrid
 end

如果有人能告诉我哪里出错了,我将不胜感激。

我的 Gemfile 如下:

来源“ https://rubygems.org

宝石'导轨','3.2.13'

    gem 'pg'
    gem 'mail'
    gem 'griddler'

 group :development, :test do
  gem 'quiet_assets'
  gem 'pry'
  gem 'rspec-rails'
  gem 'faker'
  gem 'factory_girl_rails'
  gem 'guard-rspec'
end

 group :test do
   gem 'capybara'
   gem 'poltergeist'
   gem 'database_cleaner'
   gem 'shoulda-matchers'
   gem 'simplecov', require: false
 end


 group :assets do
   gem 'sass-rails',   '~> 3.2.3'
   gem 'coffee-rails', '~> 3.2.1'



  gem 'uglifier', '>= 1.0.3'
end

  gem 'jquery-rails'

捆绑安装输出

   Using rake (10.1.0)
   Using i18n (0.6.1)
   Using multi_json (1.7.7)
   Using activesupport (3.2.13)
   Using builder (3.0.4)
   Using activemodel (3.2.13)
   Using erubis (2.7.0)
   Using journey (1.0.4)
   Using rack (1.4.5)
   Using rack-cache (1.2)
   Using rack-test (0.6.2)
   Using hike (1.2.3)
   Using tilt (1.4.1)
   Using sprockets (2.2.2)
   Using actionpack (3.2.13)
   Using mime-types (1.23)
   Using polyglot (0.3.3)
   Using treetop (1.4.14)
   Using mail (2.5.4)
   Using actionmailer (3.2.13)
   Using arel (3.0.2)
   Using tzinfo (0.3.37)
   Using activerecord (3.2.13)
   Using activeresource (3.2.13)
   Using bundler (1.3.5)
   Using mini_portile (0.5.0)
   Using nokogiri (1.6.0)
   Using xpath (2.0.0)
   Using capybara (2.1.0)
   Using coderay (1.0.9)
   Using coffee-script-source (1.6.2)
   Using execjs (1.4.0)
   Using coffee-script (2.2.0)
   Using rack-ssl (1.3.3)
   Using json (1.8.0)
   Using rdoc (3.12.2)
   Using thor (0.18.1)
   Using railties (3.2.13)
   Using coffee-rails (3.2.2)
   Using database_cleaner (1.0.1)
   Using diff-lcs (1.2.4)
   Using eventmachine (1.0.3)
   Using factory_girl (4.2.0)
   Using factory_girl_rails (4.2.1)
   Using faker (1.1.2)
   Using faye-websocket (0.4.7)
   Using ffi (1.9.0)
   Using formatador (0.2.4)
   Using htmlentities (4.3.1)
   Using rails (3.2.13)
   Using griddler (0.5.0)
   Using rb-fsevent (0.9.3)
   Using rb-inotify (0.9.0)
   Using rb-kqueue (0.2.0)
   Using listen (1.2.2)
   Using lumberjack (1.0.3)
   Using method_source (0.8.1)
   Using slop (3.4.5)
   Using pry (0.9.12.2)
   Using guard (1.8.1)
   Using rspec-core (2.13.1)
   Using rspec-expectations (2.13.0)
   Using rspec-mocks (2.13.1)
   Using rspec (2.13.0)
   Using guard-rspec (3.0.2)
   Using http_parser.rb (0.5.3)
   Using jquery-rails (3.0.1)
   Using pg (0.15.1)
   Using poltergeist (1.3.0)
   Using quiet_assets (1.0.2)
   Using rspec-rails (2.13.2)
   Using sass (3.2.9)
   Using sass-rails (3.2.6)
   Using shoulda-matchers (2.2.0)
   Using simplecov-html (0.7.1)
   Using simplecov (0.7.1)
   Using uglifier (2.1.1)

您的捆绑包已完成!

路线.rb

RedLantern::Application.routes.draw do

  resources :tickets do
    resources :replies, only: [:create]
  end

  match "/inbound" => "inbound#create"

  mount_griddler ('/email/incoming')

  root :to => "tickets#index"
end
4

1 回答 1

0

最新发布的 Griddler 版本, v0.5.0版本不包含mount_griddler帮助程序。

在那个版本中,引擎会自动添加一个到POSTto的路由/email_processor,并且README指定了一种在需要时覆盖它的方法。

未来的版本将需要mount_griddler方法config/routes.rb并提供更多的灵活性。

对于那个很抱歉。

于 2013-08-05T03:22:56.113 回答