1

Mecury Editor をインストールした後、サーバーを起動しようとすると、次のようになります。

in `normalize_conditions!': You should not use the `match` method in your router without specifying an HTTP method. (RuntimeError)
If you want to expose your action to both GET and POST, add `via: [:get, :post]` option.
If you want to expose your action to GET, use `get` in the router:
  Instead of: match "controller#action"
  Do: get "controller#action"

ここにルートファイルがあります

Bootcanvise::Application.routes.draw do

Mercury::Engine.routes



  resources :newsletters

  resources :advertisers

  devise_for :users
  get "home/index"
  # The priority is based upon order of creation: first created -> highest priority.
  # See how all your routes lay out with "rake routes".

  # You can have the root of your site routed with "root"
  root 'home#index'
end

ルートファイルを編集しようとしましたが、同じエラーが発生し続けます

これは、routes.rb ファイルに対する理解が不足しているためだと思われます。

4

2 に答える 2

0

Mercury gem が作成したルートが問題の原因です。

Mercury が作成したルート (私がこれを書いている時点では現在の gem) を変更する必要があります。

このroutes.rb行を変更します。

Mercury::Engine.routes

これに:

mount Mercury::Engine => '/'

その後、あなたは行く準備ができているはずです!

于 2015-04-08T05:01:17.470 に答える