Setting and using actions like-taggable-on

It will be a very stupid question, I just know it, but I will ask anyway, because it drives me crazy.

How can I make act-as-taggable-on work?

I installed it as a gem with gem install acts-as-taggable-on , because I can never get the plugins to work, but this is a whole different batch of questions, which are probably really dumb. In any case, there are no problems, it is installed correctly.

I did a ruby script/generate acts_as_taggable_on_migration and rake db:migrate , again no problem.

I added acts_as_taggable to the model I want to use tags with, started the server, and then loaded the index for the model to see if I still work, and received the following error: undefined local variable or `act_as_taggable 'method for #.

I suppose that just means that I need to do something like require 'acts-as-taggable-on' for my model file, because this is usually necessary for gems. So, I did this update and got uninitialized constant ActiveRecord::VERSION . I'm not even going to pretend that I'm starting to understand what it means that it is not.

I was wrong somewhere or something else needs to be done. The installation instructions seem to me such that they simply assume that you generally know what you are doing, and do not even begin to explain what to do when something goes wrong.

+7
ruby ruby-on-rails rubygems ruby-on-rails-plugins acts-as-taggable-on
source share
3 answers

You tried to define your gem dependencies in config / environment.rb (Rails 2.3):

 Rails::Initializer.run do |config| #... config.gem 'acts-as-taggable-on' #... end 

Either in the Gemfile for Rails 3 or if you are already using the Bundler with rails 2.3:

 gem 'acts-as-taggable-on' 

This should make unnecessary require 'acts-as-taggable-on'

+1
source share

Perhaps after installation here may help.

For example, you do not need:

 require 'acts-as-taggable-on' 

but

 class User < ActiveRecord::Base acts_as_taggable end 

Otherwise, you need to send additional information about the error.

+1
source share

I installed act-as-taggable-on for my application via github. If you want to try this method instead of a gem, you can read my post that explains my experience: http://blog.mediummassage.com/2010/04/27/creating-categories-in-the-store-with-tags /

+1
source share

All Articles