我按照这个指南安装Spree网站时(链接:http://guides.spreecommerce.com/getting_started.html),遇到了如下问题:
deploy@bothunter:~/rails$ sudo -i gem install rails
Successfully installed rails-3.2.1
1 gem installed
deploy@bothunter:~/rails$ sudo -i gem install bundlerSuccessfully installed bundler-1.0.22 1 gem installed
deploy@bothunter:~/rails$ sudo -i gem install spree
Successfully installed spree-1.0.0 1 gem installed
deploy@bothunter:~/rails$ rails new mystore -d mysql create
create README.rdoc
create Rakefile
create config.ru
.....run bundle install
Fetching source index for https://rubygems.org/
Using rake (0.9.2.2)
Using activemodel (3.2.1)
..... Using rack-test (0.6.1)
Using hike (1.2.1)
Using actionpack (3.2.1) ..... Using coffee-rails (3.2.2)
Using jquery-rails (2.0.0)
Using mysql2 (0.3.11)
Using rails (3.2.1)
Using uglifier (1.2.3)
Your bundle is complete! Usebundle show [gemname]
to see where a bundled gem is installed.deploy@bothunter:~/rails$ cd mystore
deploy@bothunter:~/rails/mystore$ spree install
Would you like to install the default gateways? (yes/no) [yes]
... gemfile spree gemfile spree_usa_epay
gemfile spree_skrill run
bundle install from "."
git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please runbundle install
precompiling assetsgit://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run
bundle install
deploy@bothunter:~/rails/mystore$ bundle install
Updating git://github.com/spree/spree_usa_epay.gitUpdating git://github.com/spree/spree_skrill.git
Fetching source index for sitename.com Bundler could not find compatible versions for gem "rails":
**In Gemfile: spree_usa_epay (>= 0) ruby depends on rails (<= 3.1.3, >= 3.1.1) ruby**rails (3.2.1)**
deploy@bothunter:~/rails/mystore$
But...
deploy@bothunter:~/rails/mystore$ gem --list rails (3.2.1, **3.1.3**) railties (3.2.1, **3.1.3**) rake (0.9.2.2, 0.9.2)
如何解决它?
sudo -i
安装 gem。 - mpapisbundle install
了吗? - mpapisbundle update
将从头开始重新构建您的快照,仅使用Gemfile中的宝石,这可能会解决问题。deploy@bothunter:~/rails/mystore$ bundle update 更新git://github.com/spree/spree_usa_epay.git 更新git://github.com/spree/spree_skrill.git 获取站点的源索引 Bundler无法找到与gem“rails”兼容的版本: 在Gemfile中: spree_usa_epay(>=0)ruby依赖于 rails(<=3.1.3,>=3.1.1)rubyrails(3.2.1)
- Павел Иванов