2
votes

I am trying to install the spree gem using the following instructions http://spreecommerce.com/resources/quick-start

The install worked fine, but trying to create an application doesn't resolve

bash: spree: command not found

PATH is /Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/bin:/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0@global/bin:/Users/sandbox1/.rvm/rubies/ruby-1.9.2-p0/bin:/Users/sandbox1/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/usr/X11/bin bash-3.2$

Should I add something from the below output to my PATH?

bash-3.2$ find $HOME -name spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/doc/spree-0.30.0/rdoc/lib/generators/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/doc/spree_auth-0.30.0/rdoc/lib/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/doc/spree_core-0.30.0/rdoc/lib/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree-0.30.0/lib/generators/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_auth-0.30.0/app/controllers/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_auth-0.30.0/lib/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_core-0.30.0/app/controllers/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_core-0.30.0/app/helpers/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_core-0.30.0/lib/spree
/Users/sandbox1/.rvm/gems/ruby-1.9.2-p0/gems/spree_core-0.30.0/public/images/spree
bash-3.2$ 
2
Same problem here, any solutions?Chris
Actually, newer versions of spree don't have a command line tool installed. Instead it's a rails engine. See "4 Creating a New Spree Project" here: spreecommerce.com/documentation/getting_started.htmlChris
That tutorial for install Spree says to use sudo. Do NOT use sudo when installing a gem if your Ruby is under RVM's control unless you KNOW what you are doing and why you would want to do that. RVM uses a sandbox and sudo will do a jailbreak and put the gem in the wrong place.the Tin Man

2 Answers

3
votes

What Chris said: You can create a rails 3.0 app and add the spree gem to the app, as documented in http://spreecommerce.com/documentation/getting_started.html#creatinga-new-spree-project.

  1. Create you project with e.g., rails new spreetest
  2. Add gem 'spree' to the Gemfile
  3. Perform bundle install to install missing gems
  4. Initialize the spree site with rails g spree:site and rake spree:install
  5. Optionally, install sample data rake spree_sample:install
  6. Populate the database with rake db:bootstrap
  7. Run the server with rails server
-1
votes

From what I read on Spree homepage, they recommend you to perform the Gem installation using sudo. However, RVM says you should not use sudo. Try installing the Gem again, this time without sudo.