Skip to content

Instantly share code, notes, and snippets.

@inky
Created May 24, 2010 10:59
Show Gist options
  • Save inky/411748 to your computer and use it in GitHub Desktop.
Save inky/411748 to your computer and use it in GitHub Desktop.
Thinking of taking up coffee.
$ gem install spree
ERROR: Error installing spree:
actionpack requires rack (~> 1.0.0, runtime)
$ gem install rack
Successfully installed rack-1.1.0
1 gem installed
$ gem install spree
ERROR: Error installing spree:
actionpack requires rack (~> 1.0.0, runtime)
$ gem install rack -v=1.0.0
Successfully installed rack-1.0.0
1 gem installed
$ gem install spree
...
26 gems installed
$ rake gems:install
Missing the Spree 0.10.2 gem. Please `gem install -v=0.10.2 spree`, update your SPREE_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out SPREE_GEM_VERSION to use the latest version installed.
[commented out the SPREE_GEM_VERSION line]
$ rake gems:install
Missing the Spree gem. Please `gem install -v= spree`, update your SPREE_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out SPREE_GEM_VERSION to use the latest version installed.
[uncommented "SPREE_GEM_VERSION = '0.10.2'" again]
$ gem install -v=0.10.2 spree
Successfully installed spree-0.10.2
1 gem installed
$ ./script/server
Missing the Spree 0.10.2 gem. Please `gem install -v=0.10.2 spree`, update your SPREE_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out SPREE_GEM_VERSION to use the latest version installed.
$ spree derp
/Library/Ruby/Site/1.8/rubygems.rb:233:in `activate': can't activate rack (>= 1.0.1, runtime) for ["spree-0.10.2"], already activated rack-1.0.0 for ["actionpack-2.3.5", "rails-2.3.5", "spree-0.10.2"] (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems.rb:249:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:248:in `each'
from /Library/Ruby/Site/1.8/rubygems.rb:248:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:1082:in `gem'
from /Users/inky/.gem/ruby/1.8/bin/spree:18
$ gem uninstall rack -v=1.1.0
Select gem to uninstall:
1. rack-1.1.0
2. rack-1.1.0
3. All versions
> 2
You have requested to uninstall the gem:
rack-1.1.0
actionpack-2.3.7 depends on [rack (~> 1.1.0)]
spree-0.10.2 depends on [rack (>= 1.0.1)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] n
ERROR: While executing gem ... (Gem::DependencyRemovalException)
Uninstallation aborted due to dependent gem(s)
$ shutdown
@williamdodson
Copy link

Made me laugh because that's exactly how my last 3 days have been. Thanks for sharing your pain. :)

@mraaroncruz
Copy link

google brought me to you. throw rvm into the mix and you have a spree party!

@bekasgr
Copy link

bekasgr commented Oct 14, 2010

so any news from you ?

@deepak
Copy link

deepak commented Oct 16, 2010

yup - it is a pain. on the bright side, bundler or rvm gemsets can solve this problem.
but you have to find out and define the dependencies once - it only manages the dependency. we do not have to go through the pain a second time.

also you should have tried

rake gems:install
at first

that way u would not have installed spree and then removed it, the rake task would have taken care to install the proper dependency.
also i never manually install a lower dependency in a project, install it in a rvm gemset.
know from personal experience that upgrading rack breaks stuff as it is used in a lot of places.
rails + rack
merb + rack
resque + rack
passenger + rack
+ pack

do not manually install rack and other smaller libs other than in a gemset and after making sure the dependencies are defined in ur project and the app starts up, lock the bundle and check it in git

and then have a coffee :-)

@deepak
Copy link

deepak commented Oct 16, 2010

another good practice is to have a rvm gemset per-project u are working on.

http://rvm.beginrescueend.com/workflow/rvmrc/

echo "rvm ree@projectb" > ~/projects/projectb/.rvmrc

this segregates the gems quite nicely, one project will not break due to another project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment