Rails SpreeCommerce国际化

时间:2013-09-09 19:48:17

标签: ruby-on-rails spree

您好我想更改Spreecommerce的语言并添加(以下文档https://github.com/spree/spree_i18n)gems

Gemfile

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

但如果我运行bundle install即时错误

Resolving dependencies...
Bundler could not find compatible versions for gem "activerecord":
  In Gemfile:
    globalize3 (>= 0) ruby depends on
      activerecord (>= 4.0.0) ruby

    rails (= 3.2.14) ruby depends on
      activerecord (3.2.14)

我的spreecommerce版本是稳定的2.0,我的Gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.14'

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

gem 'sqlite3'
gem 'spree', github: 'spree/spree', branch: '2-0-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-0-stable'

# Lokalizace
gem 'spree_i18n', github: 'spree/spree_i18n'
gem 'globalize3', github: 'svenfuchs/globalize3', branch: 'rails4'
gem 'paper_trail', github: 'airblade/paper_trail'

# 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'
end

gem 'jquery-rails'

我也尝试了这个gem 'spree_i18n', github: 'spree/spree_i18n', branch: '2-0-stable',但没有区别,现在呢? : - )

1 个答案:

答案 0 :(得分:2)

您的错误说明

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

ActiveRecord是Rails的组成部分。

您的Gemfile声明:

gem 'rails', '3.2.14'

这显示您的项目正在使用Rails 3.2.14,但您的一个宝石需要Rails 4.0.0。

有问题的宝石是:

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

您应该修改此版本以使用Rails 3.2.x兼容版本,并运行bundle install来解决此问题。