首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么mount_griddler是一个未定义的方法?

为什么mount_griddler是一个未定义的方法?
EN

Stack Overflow用户
提问于 2013-07-23 23:48:18
回答 1查看 346关注 0票数 0

我正在尝试使用Griddler宝石,并在我的Gemfile中为'griddler‘做了一个捆绑安装。在我的routes.rb中,我添加了一行:

代码语言:javascript
复制
mount_griddler ('/email/incoming')

当我尝试运行rails s时,我总是得到错误:

代码语言:javascript
复制
'block in <top (required)>': undefined method 'mount_griddler' for #<ActionDispatch::Routing::Mapper:0x007fa995bba030> (NoMethodError)

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

代码语言:javascript
复制
   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

如果有人能告诉我哪里出了问题,我会很感激的。

我的个人档案如下:

源'https://rubygems.org‘ gem 'rails','3.2.13‘

代码语言:javascript
复制
    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'

捆绑安装输出

代码语言:javascript
复制
   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)

你的包裹完成了!

routes.rb

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-08-05 03:22:56

最新发布的Griddler版本,v0.5.0不包括mount_griddler助手。

在该版本中,引擎会自动将路由添加到POST/email_processor,而自述文件指定了一种在需要时重写该路由的方法。

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

真对不起。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17822894

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档