3
votes

At the time I install the Spree site (in according with this guide: http://guides.spreecommerce.com/getting_started.html) , I get this problem:

deploy@bothunter:~/rails$ sudo -i gem install rails
Successfully installed rails-3.2.1
1 gem installed
deploy@bothunter:~/rails$ sudo -i gem install bundler

Successfully 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! Use bundle 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 run bundle install precompiling assets

git://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.git

Updating 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)

How to solve it?

2
you should not install gems with sudo -impapis
having the same problem also. Right now I'm using rbenv to manage my ruby versions, but thinking of switching back to RVM so that I have control over my gemsets, that way I can manage which rails gem to use per project or whatever.Andre Dublin
'you should not install gems with sudo -i' @mpapis, it doesn't matter, because with "sudo gem" the same situation... i think, that: # gem 'spree_usa_epay', :git => 'git://github.com/spree/spree_usa_epay.git', :ref => '0cb57b4afbf1eef6a0ad67a4a1ea506c6418fde1' # gem 'spree_skrill', :git => 'git://github.com/spree/spree_skrill.git', :ref => '37e6159aa71ec053499e2c7aa9cf799a3b3bdb39' has old dependencies... no?Павел Иванов
sudo -i is bad idea it might change the environment and the place where gems are installed, as for the error, have you tried running bundle install as advertised ?mpapis
@mpapis, I did it (exit, su deploy...), but: In Gemfile: spree_skrill (>= 0) ruby depends on spree_core (>= 0.70.1) ruby Running bundle update will rebuild your snapshot from scratch, using only the gems in your Gemfile, which may resol. deploy@bothunter:~/rails/mystore$ bundle update Updating git://github.com/spree/spree_usa_epay.git Updating git://github.com/spree/spree_skrill.git Fetching source index for site 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)Павел Иванов

2 Answers

5
votes

Spree 1.0 only works with Rails 3.1.3. We'll be looking at supporting Rails 3.2 in the next minor release of Spree. Until that comes out, use 3.1.3, like this:

gem install rails -v 3.1.3
3
votes

I'm pretty sure the problem here is that the rails version has progressed ahead of what spree is expecting. So if you create the new rails app with the 3.1.3 version by typing in:

rails _3.1.3_ new my_app_name

then you will get past this error. However, after that, I got another error during bundle install that I have not yet solved.