How can I get around NoMethodError with Vestal Versions on Rails 3.2 and Ruby 1.9.3?

168 Views Asked by At

OK - I think I've searched everywhere, I'd think this ought to be a duplicate question, but still don't have a basic vestal_versions (1.2.2) working after looking and trying multiple things. I'm early on in development, so I'm open to other versioning solutions that actually work on Rails 3.2 and Ruby 1.9.3.

The repo owner is looking for another champion (maybe that should tell me something hehe), so maybe its not possible without some TLC, but I'd appreciate it if someone has got it figured out.

Thanks for your time!

Here's my situation:

  • Max Os X 10.8.2
  • mac ports: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11]
  • Rails 3.2.8

In my Gemfile

stuff...
gem 'mysql2'
gem 'vestal_versions', :git => 'git://github.com/laserlemon/vestal_versions.git'
more stuff...

bundle tells me I've got: - Using vestal_versions (1.2.2) from git://github.com/laserlemon/vestal_versions.git (at master)

My Model:

class StoryPage < ActiveRecord::Base
  versioned

  belongs_to      :story

  attr_accessible :page_num, :title, :story_version, has_been_deleted, :content
end

From my controller:

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

The Error Output Contains:

> 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'
1

There are 1 best solutions below

0
On

Try: bundle update rake

Also if you are getting MassAssignmentSecurity::Error try this fix: https://github.com/laserlemon/vestal_versions/issues/86