好的 - 我想我到处都搜索过,我认为这应该是一个重复的问题,但是在查看和尝试多个事情后仍然没有基本的vestal_versions(1.2.2)工作。我很早就开发了,所以我对其他版本控制解决方案持开放态度,这些解决方案实际上适用于Rails 3.2和Ruby 1.9.3。
回复所有者正在寻找另一个冠军(也许应该告诉我一些hehe),所以也许没有一些TLC就不可能,但如果有人弄清楚它,我会很感激。谢谢你的时间!
这是我的情况:
在我的Gemfile中
stuff...
gem 'mysql2'
gem 'vestal_versions', :git => 'git://github.com/laserlemon/vestal_versions.git'
more stuff...
捆绑告诉我,我有: - 使用来自git://github.com/laserlemon/vestal_versions.git(主人)的vestal_versions(1.2.2)
我的模特:
class StoryPage < ActiveRecord::Base
versioned
belongs_to :story
attr_accessible :page_num, :title, :story_version, has_been_deleted, :content
end
来自我的控制器:
def create
@story = current_user.stories.create(
:name => params[:stories][:name] || 'New Story',
:description => params[:stories][:description] || ''
)
# Add a blank page
@story.story_pages.create(
:title => 'New Page',
:page_num => 1,
:story_version => @story.version
)
@story.save
respond_with(@story) do |format|
format.html
format.json
end
end
错误输出包含:
> DEPRECATION WARNING: The InstanceMethods module inside
> ActiveSupport::Concern will be no longer included automatically.
> Please define instance methods directly in VestalVersions::Changes
> instead. (called from include at
> /Users/leo_odonnell/.bundler/ruby/1.9.1/vestal_versions-6273df533f85/lib/vestal_versions.rb:109)
> # and more like that, then
> NoMethodError (undefined method `class_inheritable_accessor' for #<Class:0x007fa59e5c9400>):
> app/models/story_page.rb:2:in `<class:StoryPage>'
> app/models/story_page.rb:1:in `<top (required)>'
> app/controllers/stories_controller.rb:22:in `create'
答案 0 :(得分:0)
尝试:捆绑更新rake
此外,如果您收到MassAssignmentSecurity :: Error,请尝试此修复程序:https://github.com/laserlemon/vestal_versions/issues/86