RefineryCMS:投资组合库插件引入的路由错误

时间:2015-09-30 13:40:49

标签: ruby-on-rails ruby ruby-on-rails-4 gem refinerycms

我使用RefineryCMS作为rails CMS,在我按照this问题中的答案进行简单的图片库功能之前,它就像魅力一样。现在我收到this问题所示的相同错误。我没有改变我的任何rails代码来引入带有nil引用的link_to标记,但是(指南中有一个link_to image_tag行,但我已经注释掉了,没有改变),所以&# 39;我相信在自动生成的代码中发生的事情。这是我在网站上登录精炼厂时遇到的完整错误:

ActionController::UrlGenerationError in Refinery::Authentication::Devise::Admin::Users#index
Showing /home/mpvoss/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bundler/gems/refinerycms-0a37f8090278/core/app/views/refinery/admin/_menu_item.html.erb where line #1 raised:

No route matches {:action=>"index", :controller=>"refinery/refinery/portfolio/admin/galleries", :locale=>:en}
Extracted source (around line #46):            
44 message << " missing required keys: #{missing_keys.sort.inspect}"     unless missing_keys.empty?
45
46 raise ActionController::UrlGenerationError, message
47 end
48
49 def clear

Trace of template inclusion: /home/mpvoss/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bundler/gems/refinerycms-0a37f8090278/core/app/views/refinery/admin/_menu.html.erb, /home/mpvoss/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/bundler/gems/refinerycms-0a37f8090278/core/app/views/layouts/refinery/admin.html.erb

注意:只需加载网站而不登录精炼厂,因为它没有尝试加载下面遇到路由问题的菜单代码。

好的,让我们来看看 _menu.html.erb

<%= link_to menu_item.title, refinery.url_for(menu_item.url),
        :class => ("active" if menu_item.highlighted?(params)),
        :id => "plugin_#{menu_item.name}" %>

此代码只为所有插件创建一个菜单栏。它可以被注释掉,炼油厂也可以工作(上面的错误消失了),但是我需要用菜单栏对网站进行更改。

我尝试过的事情。

  • 我在〜/ .rbenv / versions / 2.2.1 / lib / ruby​​ / gems / 2.2.0 / bundler / gems / refinerycms-portfolio-289b85b18771 / app / controllers / refinery /中找到了galleries_controller.rb组合/管理员,这似乎是错误所讨论的控制器。它没有索引操作,所以我添加了一个空操作,看看是不是问题而且没有任何改变。 〜/ .rbenv / versions / 2.2.1 / lib / ruby​​ / gems / 2.2.0 / bundler / gems / refinerycms-portfolio-289b85b18771 / gem的routes.rb位于

  • 之下
  • 在我的Gemfile中注释了gem gem并运行了bundle install,但我得到了同样的错误,因为自动生成的代码(指的是像.rbenv / versions / 2.2.1 / lib / ruby​​ / gems / 2.2这样的东西。 0 / bundler / gems / refinerycms-0a37f8090278 /)仍在执行中(我使用git进行版本控制,并在这些更改之前对项目进行干净的克隆,并且它有同样的问题,因为自动生成的代码不是版本控制的一部分)。

  • 我认为可能导致问题的炼油厂 - 照片库,refinerycms-page-images和refinerycms-portfolio宝石的宝石卸载
  • 我将〜/ .rbenv / versions / 2.2.1 / lib / ruby​​ / gems / 2.2.0 / bundler / gems /中的所有宝石移出该目录,以查看捆绑安装是否会重新生成新鲜,干净的宝石但没有改变。

这些想法都没有起到作用。如果需要任何澄清,请告诉我。我被困了一个星期,我的谷歌搜索技能让我失望。任何帮助都非常感谢!

〜/ .rbenv /版本/ 2.2.1 / LIB /红宝石/宝石/ 2.2.0 /捆绑/宝石/ refinerycms-组合-289b85b18771 / routes.rb中

 Refinery::Core::Engine.routes.draw do

  # Frontend routes
  namespace :portfolio, :path => Refinery::Portfolio.page_url do
    root :to => "galleries#index"
    resources :galleries, :only => [:index, :show]
  end

  # Admin routes
  namespace :portfolio, :path => '' do
    namespace :admin, :path => Refinery::Core.backend_route do
      scope :path => 'portfolio' do
        resources :galleries, :except => :show do
          get :children, :on => :member
          post :update_positions, :on => :collection
          resources :items, :except => [:show] do
            post :update_positions, :on => :collection
          end
        end
        resources :items do
          post :update_positions, :on => :collection
        end
      end
    end
  end
end

的Gemfile

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.3'
# Use sqlite3 as the database for Active Record
group :development, :test do
  gem 'sqlite3'
end
# Use SCSS for stylesheets
# Use Uglifier as compressor for JavaScript assets
# Use CoffeeScript for .coffee assets and views
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more:     https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger     console
  gem 'byebug'

  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the     background. Read more: https://github.com/rails/spring
  gem 'spring'
end

# Added by Matthew, Thin server
gem 'faye'
gem 'thin'

group :assets do
  #gem 'sass-rails', '~> 3.2.3'
  gem 'coffee-rails', '~> 4.1.0'
  gem 'sass-rails', '~> 5.0'
  #gem 'coffee-rails', '~> 3.2.1'
  gem 'bootstrap-sass','~> 3.1.1'
  gem 'uglifier', '>= 1.3.0'
  #gem 'uglifier', '>= 1.0.3'
end

  gem 'twitter-bootstrap-rails'
gem 'refinerycms', git: 'https://github.com/refinery/refinerycms', branch: 'master'
#gem 'refinerycms-page-images', '~> 2.0.0'
gem 'quiet_assets', group: :development
#gem 'refinerycms-photo-gallery', '~> 0.1.0'
# Add support for searching inside Refinery's admin interface.
gem 'refinerycms-acts-as-indexed', ['~> 2.0', '>= 2.0.0']

# Add support for Refinery's custom fork of the visual editor WYMeditor.
gem 'refinerycms-wymeditor', ['~> 1.0', '>= 1.0.6']
gem 'refinerycms-portfolio', github: 'refinery/refinerycms-portfolio', branch:     'master'
# The default authentication adapter
gem 'refinerycms-authentication-devise', '~> 1.0'

1 个答案:

答案 0 :(得分:0)

看起来这是一个组合/图像插件中的错误,尝试了另一个包更新,更新的代码就像一个魅力。 &lt; 3 RefineryCMS贡献者