rails globalize3 on rails 4

时间:2013-07-26 12:08:43

标签: ruby-on-rails-4 gemfile globalize3 globalize

有人使用带有rails 4的globalize 3。 你如何配置它?

我尝试在我的Gemfile上安装:

gem 'globalize3', github: 'svenfuchs/globalize3', branch: 'rails4'

但我有这些错误:

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    globalize3 (>= 0) ruby depends on
      railties (~> 3.0) ruby

    coffee-rails (~> 4.0.0) ruby depends on
      railties (4.0.0)

Bundler could not find compatible versions for gem "rails":
  In Gemfile:
    globalize3 (>= 0) ruby depends on
      rails (~> 3) ruby

    rails (4.0.0)

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    rails (= 4.0.0) ruby depends on
      actionpack (= 4.0.0) ruby

    simple_form (~> 3.0.0.rc) ruby depends on
      actionpack (4.0.0.rc1)

4 个答案:

答案 0 :(得分:2)

globalize3 gem已重命名为globalize,主要版本号现在对应于ActiveRecord的相应版本(AR3为3.x,AR4为4.x)。

所以你需要做的就是把它放在你的Gemfile中,你不应该有任何冲突:

gem 'globalize', '~> 4.0.0.alpha.2'

有关详细信息,另请参阅github repository

答案 1 :(得分:1)

尝试在你的Gemfile中使用这两行:

gem 'paper_trail', github: 'airblade/paper_trail', branch: 'rails4'
gem 'globalize3', github: 'svenfuchs/globalize3', branch: 'rails4', ref: 'ffb5c771b9'

答案 2 :(得分:0)

使用它。 Paper_trail将rails4合并到master分支中。

gem 'globalize3', github: 'svenfuchs/globalize3', branch: 'rails4'
gem 'paper_trail', github: 'airblade/paper_trail', branch: 'master'

答案 3 :(得分:0)

这对我有用:

gem 'globalize', '~> 4.0.2'

请在此处查看最新说明:

https://github.com/globalize/globalize#installation