mbleigh / acts-as-taggable-on

A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.
http://mbleigh.lighthouseapp.com/projects/10116-acts-as-taggable-on
MIT License
4.98k stars 1.19k forks source link

Can't run rspec when using Rails 5 and acts-as-taggable-on 4 #854

Closed zhangjingqiang closed 6 years ago

zhangjingqiang commented 7 years ago

Versions

Gemfile

gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
gem 'acts-as-taggable-on', '~> 4.0'

group :development, :test do
  gem 'rspec-rails', '~> 3.5'
end

Logic

lib/acts_as_taggable_on/generic_parser.rb

class MyParser < ActsAsTaggableOn::GenericParser
  def parse
    ActsAsTaggableOn::TagList.new.tap do |tag_list|
      tag_list.add @tag_list.split(',').map(&:strip).reject(&:empty?)
    end
  end
end

Exception

When running rpsec, got these errors:

/Users/user/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'acts-as-taggable-on'. (Bundler::GemRequireError)
Gem Load Error is: uninitialized constant ActsAsTaggableOn::GenericParser
seuros commented 6 years ago

Try with the latest version