如果我播种或尝试创建页面,我会遇到下面列出的错误.我已经进行了双重检查,并且所有迁移似乎都包含在内(附加),所有迁移都已启动.数据库模式(部分附加)似乎处于正常工作状态.
我唯一能想到的是,宝石可能存在冲突,但我不确定如何.我添加了我的gemfile,任何更熟悉Rails的人都可以发现它.
谢谢!
尝试运行rake db:seed时出错
rake db:seed --trace** Invoke db:seed (first_time)** Execute db:seed** Invoke db:abort_if_pending_migrations (first_time)** Invoke environment (first_time)** Execute environment** Execute db:abort_if_pending_migrationsrake aborted!uninitialized constant RefineryPage/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:229:in `block in constantize'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `each'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `constantize'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/active_scaffold-3.2.3/lib/active_scaffold/extensions/reverse_associations.rb:34:in `block in autodetect_inverse'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/active_scaffold-3.2.3/lib/active_scaffold/extensions/reverse_associations.rb:26:in `each'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/active_scaffold-3.2.3/lib/active_scaffold/extensions/reverse_associations.rb:26:in `autodetect_inverse'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/active_scaffold-3.2.3/lib/active_scaffold/extensions/reverse_associations.rb:15:in `inverse_of_with_autodetect'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/associations/association.rb:212:in `inverse_reflection_for'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/associations/association.rb:217:in `invertible_for?'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/associations/association.rb:108:in `set_inverse_instance'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/associations/collection_association.rb:351:in `add_to_target'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/associations/collection_association.rb:112:in `build'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/associations/collection_proxy.rb:46:in `build'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/globalize3-0.2.0/lib/globalize/active_record/instance_methods.rb:134:in `translation_for'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/globalize3-0.2.0/lib/globalize/active_record/adapter.rb:77:in `fetch_attribute'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/globalize3-0.2.0/lib/globalize/active_record/adapter.rb:24:in `block in fetch'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/globalize3-0.2.0/lib/globalize/active_record/adapter.rb:23:in `each'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/globalize3-0.2.0/lib/globalize/active_record/adapter.rb:23:in `fetch'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/globalize3-0.2.0/lib/globalize/active_record/instance_methods.rb:67:in `read_attribute'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/globalize3-0.2.0/lib/globalize/active_record/class_methods.rb:114:in `block in translated_attr_accessor'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activemodel-3.2.3/lib/active_model/dirty.rb:154:in `attribute_will_change!'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/globalize3-0.2.0/lib/globalize/active_record/instance_methods.rb:49:in `write_attribute'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/globalize3-0.2.0/lib/globalize/active_record/class_methods.rb:111:in `block in translated_attr_accessor'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/attribute_assignment.rb:85:in `block in assign_attributes'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/attribute_assignment.rb:78:in `each'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/attribute_assignment.rb:78:in `assign_attributes'(eval):3:in `block in assign_attributes'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/globalize3-0.2.0/lib/globalize/active_record/instance_methods.rb:170:in `with_given_locale'(eval):3:in `assign_attributes'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/base.rb:498:in `initialize'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/valIDations.rb:39:in `new'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/valIDations.rb:39:in `create!'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/refineryCMS-pages-2.0.3/db/seeds.rb:2:in `<top (required)>'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/railtIEs-3.2.3/lib/rails/engine.rb:520:in `load_seed'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/railtIEs-3.2.3/lib/rails/railtIE/configurable.rb:30:in `method_missing'/Users/chance/code/rails/nokr/db/seeds.rb:10:in `<top (required)>'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/railtIEs-3.2.3/lib/rails/engine.rb:520:in `load_seed'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/activerecord-3.2.3/lib/active_record/railtIEs/databases.rake:309:in `block (2 levels) in <top (required)>'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'/Users/chance/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/bin/rake:19:in `load'/Users/chance/code/rails/nokr/activesupport/ruby/1.9.1/bin/rake:19:in `<main>'Tasks: top => db:seed
迁移
up 20120409194703 Create refineryCMS authentication schema.refinery authenticationup 20120409194704 Create refineryCMS images schema.refinery imagesup 20120409194705 Create refineryCMS resources schema.refinery resourcesup 20120409194706 Create refineryCMS pages schema.refinery pagesup 20120409194707 Create SEO Meta.SEO Meta engine
的Gemfile
require 'rbconfig'HOST_OS = Config::CONfig['host_os']source 'http://rubygems.org'group :assets do gem 'sass-rails' gem 'coffee-rails' gem 'uglifIEr' gem 'compass'endgem 'rack'gem 'rails',"~> 3.2"group :development,:test do gem 'sqlite3'endgem "geocoder"gem "geonames"gem "devise","~> 2.0"gem "geocoder"gem "geonames"gem "paperclip","~> 2.4"gem 'transloadit-rails'gem 'uuIDtools' gem "frIEndly_ID","~> 4.0.0.beta14"gem "squeel"gem "pg"gem "cancan"gem 'kaminari'#gem 'cantango'gem "formtastic"gem 'will_paginate'gem "nested_form",:git => "git://github.com/ryanb/nested_form.git"gem 'tire',:git => 'https://github.com/karmi/tire'gem 'multi_Json'gem 'active_scaffold'gem "Meta_search"gem 'newrelic_rpm'gem 'paper_trail'gem 'jquery-rails'gem 'activeadmin',:git => "git://github.com/gregbell/active_admin.git"gem 'refineryCMS','~> 2.0.0'gem 'refineryCMS-i18n','~> 2.0.0'# gem 'refineryCMS-blog','~> 2.0.0'# gem 'refineryCMS-inquirIEs','~> 2.0.0'# gem 'refineryCMS-search','~> 2.0.0'# gem 'refineryCMS-page-images','~> 2.0.0'if HOST_OS =~ /linux/i gem 'therubyracer','>= 0.8.2'endgem "haml",">= 3.1.2"group :development do gem "haml-rails",">= 0.3.4" gem "rspec-rails",">= 2.6.1" gem "guard",">= 0.6.2" gem "rails-footnotes",">= 3.7" gem 'rb-fsevent' gem 'growl' gem "guard-bundler",">= 0.1.3" gem "guard-rails",">= 0.0.3" gem "guard-livereload",">= 0.3.0" gem "guard-rspec",">= 0.4.3" gem "guard-cucumber",">= 0.6.1"endgroup :test do gem "factory_girl_rails",">= 1.2.0" gem "cucumber-rails",">= 1.1.1" gem "capybara",">= 1.1.1" gem "database_cleaner",">= 0.6.7" gem "launchy",">= 2.0.5" gem "rspec-rails",">= 0.6.2" gem 'rb-fsevent' gem 'growl' gem "guard-bundler",">= 0.1.3" gem "guard-rspec",">= 0.6.1"end
部分架构
create_table "refinery_images",:force => true do |t| t.string "image_mime_type" t.string "image_name" t.integer "image_size" t.integer "image_wIDth" t.integer "image_height" t.string "image_uID" t.string "image_ext" t.datetime "created_at",:null => false t.datetime "updated_at",:null => false end create_table "refinery_page_part_translations",:force => true do |t| t.integer "refinery_page_part_ID" t.string "locale" t.text "body" t.datetime "created_at",:null => false end add_index "refinery_page_part_translations",["locale"],:name => "index_refinery_page_part_translations_on_locale" add_index "refinery_page_part_translations",["refinery_page_part_ID"],:name => "index_f9716c4215584edbca2557e32706a5ae084a15ef" create_table "refinery_page_parts",:force => true do |t| t.integer "refinery_page_ID" t.string "Title" t.text "body" t.integer "position" t.datetime "created_at",:null => false end add_index "refinery_page_parts",["ID"],:name => "index_refinery_page_parts_on_ID" add_index "refinery_page_parts",["refinery_page_ID"],:name => "index_refinery_page_parts_on_refinery_page_ID" create_table "refinery_page_translations",:force => true do |t| t.integer "refinery_page_ID" t.string "locale" t.string "Title" t.string "custom_slug" t.string "menu_Title" t.string "slug" t.datetime "created_at",:null => false end add_index "refinery_page_translations",:name => "index_refinery_page_translations_on_locale" add_index "refinery_page_translations",:name => "index_d079468f88bff1c6ea81573a0d019ba8bf5c2902" create_table "refinery_pages",:force => true do |t| t.integer "parent_ID" t.string "path" t.string "slug" t.boolean "show_in_menu",:default => true t.string "link_url" t.string "menu_match" t.boolean "deletable",:default => true t.boolean "draft",:default => false t.boolean "skip_to_first_child",:default => false t.integer "lft" t.integer "rgt" t.integer "depth" t.string "vIEw_template" t.string "layout_template" t.datetime "created_at",:null => false end add_index "refinery_pages",["depth"],:name => "index_refinery_pages_on_depth" add_index "refinery_pages",:name => "index_refinery_pages_on_ID" add_index "refinery_pages",["lft"],:name => "index_refinery_pages_on_lft" add_index "refinery_pages",["parent_ID"],:name => "index_refinery_pages_on_parent_ID" add_index "refinery_pages",["rgt"],:name => "index_refinery_pages_on_rgt" create_table "refinery_resources",:force => true do |t| t.string "file_mime_type" t.string "file_name" t.integer "file_size" t.string "file_uID" t.string "file_ext" t.datetime "created_at",:null => false end create_table "refinery_roles",:force => true do |t| t.string "Title" end create_table "refinery_roles_users",:ID => false,:force => true do |t| t.integer "user_ID" t.integer "role_ID" end add_index "refinery_roles_users",["role_ID","user_ID"],:name => "index_refinery_roles_users_on_role_ID_and_user_ID" add_index "refinery_roles_users",["user_ID","role_ID"],:name => "index_refinery_roles_users_on_user_ID_and_role_ID" create_table "refinery_user_plugins",:force => true do |t| t.integer "user_ID" t.string "name" t.integer "position" end add_index "refinery_user_plugins",["name"],:name => "index_refinery_user_plugins_on_name" add_index "refinery_user_plugins","name"],:name => "index_refinery_user_plugins_on_user_ID_and_name",:unique => true create_table "refinery_users",:force => true do |t| t.string "username",:null => false t.string "email",:null => false t.string "encrypted_password",:null => false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" t.string "current_sign_in_ip" t.string "last_sign_in_ip" t.integer "sign_in_count" t.datetime "remember_created_at" t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "created_at",:null => false end add_index "refinery_users",:name => "index_refinery_users_on_ID" create_table "SEO_Meta",:force => true do |t| t.integer "SEO_Meta_ID" t.string "SEO_Meta_type" t.string "browser_Title" t.string "Meta_keywords" t.text "Meta_description" t.datetime "created_at",:null => false end add_index "SEO_Meta",:name => "index_SEO_Meta_on_ID" add_index "SEO_Meta",["SEO_Meta_ID","SEO_Meta_type"],:name => "index_SEO_Meta_on_SEO_Meta_ID_and_SEO_Meta_type" create_table "user_addresses",:force => true do |t| t.integer "address_ID" t.integer "user_ID" t.datetime "created_at",:null => false end
如果您更喜欢answer there,我之前在Refinery CMS Google网上论坛上提出了这个问题.
解决方法 squeel是我在Refinery CMS上提交的问题的回答中指出的罪魁祸首:https://github.com/refinery/refinerycms/issues/1679
希望我充分回答你的问题:-)
菲尔
https://github.com/parndt
总结以上是内存溢出为你收集整理的ruby-on-rails – 为什么我在添加Refinery CMS后尝试播种时会收到“未初始化的常量RefineryPage”全部内容,希望文章能够帮你解决ruby-on-rails – 为什么我在添加Refinery CMS后尝试播种时会收到“未初始化的常量RefineryPage”所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)