Search code examples
ruby-on-railsrubygemsacts-as-audited

Having trouble getting acts_as_audited installed



I'm trying to install acts_as_audited on rails 3, but the docs seem to only refer to pre rails 3 style installs, anyone got any tips?

Heres the details,
https://github.com/collectiveidea/acts_as_audited

I have the gem installed, it shows up when I type
gem list

however the generator does not appear to be available when I try

rails generate audited_migration add_audits_table

If anyone has a preferred audit trail idea, feel free to shout.


Part B!

So now I have the right branch, I tried to install it as per the new instructions. But I get the following error Could not find gem 'acts_as_audited (= 2.0.0.rc1, runtime)' in any of the gem sources.

I've added the following to my gemfile, (source was a later addition as I tried to get it working)
source 'http://gems.github.com'
gem 'acts_as_audited', '2.0.0.rc1'

typing gem env in terminal gives,

gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.4.2
  - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-10
  - GEM PATHS:
     - /Library/Ruby/Gems/1.8
     - /Users/tmulcahy/.gem/ruby/1.8
     - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://rubygems.org/", "http://gems.github.com/"]
  - REMOTE SOURCES:
     - http://rubygems.org/
     - http://gems.github.com/

Can you help any further?
This may be stupid but these days my biggest problem with rails is getting gems installed, I always seem to have these kind of problems. It would be nice to knock it on the head once and for all.


Solution

  • Have you tried the rails3 branch? https://github.com/collectiveidea/acts_as_audited/tree/rails3

    Update:

    Scratch that, try using this gem instead. https://rubygems.org/gems/acts_as_audited_rails3. Set the Gemfile source back to source :rubygems as well.