简体   繁体   中英

Installing Mercury Editor on Rails 4 has returned routing errors

After installing Mecury Editor, when I try to start the server I get the following:

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"

Here's the routes file

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

I've tried editing the routes file but i keep getting the same error

I expect it's to do with a lack of understanding for the routes.rb file.

Today I had this problem too. It seems you installed an outdated version of mercury-rails. Updating to master will fix this, so in your Gemfile change to this:

gem 'mercury-rails', :git => 'git://github.com/jejacks0n/mercury.git'

I had to empty my rvm gemset too. After running

rvm gemset empty gemset_name && bundle install

I had an up-to-date version of mercury and its dependencies and this error disappeared ...

Be sure to install version 0.9.0 as this is current master ...

PS: If you plan to run the images migration, you have to apply this patch here:

Mercury pull request on #443

The route that your Mercury gem created is causing the problem.

You need to modify the route that Mercury created (the current gem ...at the time I'm writing this) will do this for you:

In routes.rb change this line:

Mercury::Engine.routes

To this:

mount Mercury::Engine => '/'

After that you should be good to go!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM