Before I start, I would want to say the reasons why there were difficulties in deploying Spree:
(There's a quick and dirty installation + deployment guide after this, so feel free to skip if you don't want to know care about the details.)
There are two guides you were told to look at:
Q: I already saw these! Why does my application fail to deploy on Heroku?
A: I can think up of two big reasons why, along with a chain of side-effects.
Spree just updated to version 0.30.0. The big change here is that creating a Spree setup has changed drastically. The problem with this is that the change affected about two things in both guides:
The second reason is because of Heroku itself. Heroku seems to have changed certain things over time.
Q: So, how do I solve this?
A: The main answer is to use an older version of Spree. The other answers that follow would have to make-do with a bunch of files and heroku commands to make things work.
This guide is best done on a Linux operating system. However, everything should work fine enough as long as you have all the prerequisites (Ruby, Rubygems and all necessary gems).
Open up a terminal prompt, such as Gnome-terminal.
0. Git Installation (if you haven't done it yet)
ssh-keygen
ssh-keygen -t dsa
I. Ruby, Rubygems Installation (if you haven't done it yet)
II. Gem Installation
Install Spree 0.11.0, gem install spree -v0.11.0 <-- THIS IS IMPORTANT.
III. Swann's Spree Guide, taken from here
spree your-site-name
cd your-site-name
script/extension install git://github.com/RSpace/spree-heroku.git
cp vendor/extensions/heroku/.gems ./
aws-s3 -v '0.6.2'
rake gems:install
rake db:bootstrap
script/server
You should finish with no errors.
You should see Spree on your browser once you enter http://localhost:3000
Congratulations, you have managed to set up Spree, however, this is only from your computer. Next is the other tricky part: Deploying it to Heroku.
IV. Setting up your accounts
You will need two things:
Both accounts WILL ask for your credit / debit card information. Both services are free, but they'll ask you anyway. Don't worry about it.
Your UnionBank card number (NOT the account number) should do the trick, using VISA as your option.
Amazon S3
The Amazon S3 account will serve as the file repository for Spree.
Once you have an Amazon S3 account, go to the AWS management console, then go to Amazon S3, then create a bucket.
You will need three things from Amazon S3:
You can get your key and secret from your account info. (Go to Account -> Security Credentials) You should have something like this:
You can get the bucket name from... well, what you just named the bucket.
Verifying Heroku
Verifying Heroku will allow SSL transactions later. You'll need SSL because Spree demands it.
Verify from www.heroku.com/verify, or go to your Account Info.
V. Deployment!
This is a mix of both Swann's guide and RSpace's spree-heroku instructions.
V1. Swann's Guide
gem install heroku
heroku create your-site-name --stack bamboo-ree-1.8.7
heroku addons:add "Piggyback SSL"
heroku db:push
git push heroku master
V2. RSpace's Guide
heroku config:add S3_KEY=[your S3 access key]
heroku config:add S3_SECRET=[your S3 secret]
heroku config:add S3_BUCKET=[your S3 bucket]
Go to your website now. But if it still fails, rebuild the database again:
VI. Problems!
> I get an error in Heroku!
Enter heroku logs in the terminal so you can get an idea what went wrong. If you can, post it as a comment here.
Did your website work? Were you able to finally leave Heroku's stark-white error messages? Do you see Spree? Congratulations! You just deployed Spree on Heroku. Everything should be easy from now on.
You just survived Heroku hell once again. Everything from now on should be easy.
The first thing Spree will ask you once you visit your site is an e-mail address and passwords. This will be the administrator account. That's up to you to fill!
Now, if you go to your site, you should see near nothingness. This is the default store view.
If you want to add products, categories, manage Spree and everything, just go to http://vertsolspree(yournumber).heroku.com/admin