简体   繁体   English

在添加页面时,refinerycms不起作用

[英]refinerycms not working when adding page

I'm getting this error when trying to add a new page from the dashboard with refinerycms 尝试使用refinerycms从仪表板添加新页面时出现此错误

SQLite3::ConstraintException: refinery_page_translations.refinery_page_id may not be NULL: INSERT INTO "refinery_page_translations" ("created_at", "custom_slug", "locale", "menu_title", "refinery_page_id", "slug", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) SQLite3 :: ConstraintException:refinery_page_translations.refinery_page_id可能不为NULL:INSERT INTO“refinery_page_translations”(“created_at”,“custom_slug”,“locale”,“menu_title”,“refinery_page_id”,“slug”,“title”,“updated_at” )价值(?,?,?,?,?,?,?,?)

with the next gemfile 与下一个gemfile

gem 'rails', '3.2.14' 宝石'轨道','3.2.14'

group :development, :test do gem 'sqlite3' end group:开发,:test do gem'sqlite3'结束

group :assets do gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' group:资产做宝石'sass-rails','〜> 3.2.3'宝石'coffee-rails','〜> 3.2.1'

gem 'uglifier', '>= 1.0.3' end gem'ugllifier','> = 1.0.3'结束

gem 'jquery-rails','~> 2.3.0' gem'jquery-rails','〜> 2.3.0'

gem 'refinerycms', '~> 2.1.0' 宝石'refinerycms','〜> 2.1.0'

Based on an answer I found at https://github.com/refinery/refinerycms/issues/2450 , add this to your Gemfile: 根据我在https://github.com/refinery/refinerycms/issues/2450上找到的答案,将其添加到您的Gemfile:

gem 'globalize3', '0.3.0'

and run 并运行

bundle install

if this fails you may need to do as the error output suggests, and run 如果失败,您可能需要按错误输出建议执行,然后运行

bundle update globalize3

You may need to delete and recreate your databases via 您可能需要删除并重新创建数据库

$ rm db\*.sqlite3
$ rake db:migrate db:seed

This fixed the problem for me. 这解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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