2

我想设置ActsAsTaggableOn.strict_case_match = true
根据http://5minutenpause.com/blog/2012/11/20/careful-where-you-get-your-gems-from/,看来我必须从 github 下载 gem。所以我这样做并尝试运行App。

但是,它返回此错误:(

错误信息:(我已经尝试过bundle install,但仍然是相同的错误信息!)

git://github.com/mbleigh/acts-as-taggable-on.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
Exception class:
    PhusionPassenger::UnknownError

这是我的代码!

  • 配置/初始化程序/tag_list.rb

    ActsAsTaggableOn.delimiter = ','
    ActsAsTaggableOn.remove_unused_tags = true
    ActsAsTaggableOn.strict_case_match = true

  • 宝石文件

    gem 'acts-as-taggable-on', git: 'git://github.com/mbleigh/acts-as-taggable-on.git'


我尝试更改源以直接从 ruby​​org 下载 gem,而不是从 Github。就是这样。

gem 'acts-as-taggable-on', '2.3.3'

现在它返回此错误:(

错误信息:

undefined method `strict_case_match=' for ActsAsTaggableOn:Module

我该如何解决这个问题?

更新:

宝石文件

source 'https://rubygems.org'

gem 'rails', '3.2.11'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'mysql2'
gem 'execjs'
gem 'therubyracer'
gem 'devise', '2.0.1'
gem 'recaptcha', :require => 'recaptcha/rails'
gem 'paperclip', "~> 3.0"
gem "cocaine" 
gem 'mailboxer', '0.7.0'
gem 'sunspot_rails'
gem 'sunspot_solr'
group :development do
    gem 'better_errors'
    gem 'binding_of_caller'
    #gem 'rack-mini-profiler'
end
gem 'progress_bar'
gem 'kaminari', '0.14.0'
gem "sunspot_with_kaminari", '~> 0.1'
gem 'i18n_generators'
gem 'ancestry'
gem 'acts-as-taggable-on', '2.3.3'

gem 'acts_as_commentable_with_threading'

gem 'twitter-bootstrap-rails'
gem "less-rails"

gem 'crummy', '~> 1.6.0'

gem 'rails3_acts_as_paranoid'

gem 'galetahub-simple_captcha', :require => 'simple_captcha'

gem "acts_as_follower"

gem "jpmobile"

gem "rqrcode-rails3"

gem 'acts_as_votable', '~> 0.4.0'

gem 'rails3-jquery-autocomplete'

gem "cancan"

gem 'rinku', '1.5.1'

gem 'dalli'

gem "auto_html", '1.6.0'

gem "rails_autolink"




# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
  gem 'jquery-ui-rails'

end

gem 'jquery-rails'



# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'
4

1 回答 1

2

问题在于,acts-as-taggable-on 的 2.3.3 版本是 9 个月前发布的,并且不包含strict_case_match功能。

您的 Gemfile 也看起来像这样:

gem 'acts-as-taggable-on', git: 'git://github.com/mbleigh/acts-as-taggable-on.git'

以与您相同的方式运行:

bundle update acts-as-taggable-on

如果这不起作用,只需删除您的 Gemfile.lock 并运行 bundle install 和 bundle update

请注意,它是 gem 的开发版本,尚未准备好投入生产,但您可以冒险成为 gem 的 alpha 用户并报告您发现的任何问题 :)

于 2013-04-04T08:14:00.930 回答