Advertisement
dexterbrylle

Spree on Heroku how-to

Sep 1st, 2011
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. So today, I'll be showing you how to deploy Spree on Heroku.
  2.  
  3. Let's visit this how-to guide by Jeriel.
  4. http://vertsol.pbworks.com/w/page/32745472/Setting%20up%20Spree
  5.  
  6. First things first, you must have the following:
  7. rails 3.0.10
  8. ruby 1.9.1
  9. rubygems 1.3.7
  10.  
  11. Also you should have generated and configured your ssh keys.
  12.  
  13. So let's start.
  14.  
  15. Let's install spree.
  16. (sudo) gem install spree -v0.11.0
  17.  
  18. Be patient when installing spree.
  19.  
  20. Next, let's install hoe 2.8.0 (this is an important gem to successfully run and deploy spree on heroku)
  21. (sudo) gem install hoe -v2.8.0
  22.  
  23. Now we're ready to create our rails app.
  24.  
  25. spree <-your-app-name->
  26. cd <-your-app-name->
  27.  
  28. script/extension install git://github.com/RSpace/spree-heroku.git
  29.  
  30. cp vendor/extensions/heroku/.gems ./
  31.  
  32. Let's edit our gems file.
  33.  
  34. Reminder: this step is VERY important. please copy the order of gems in this gem file.
  35.  
  36. You can edit .gems with any text editor (e.g. Notepad, gedit)
  37.  
  38. This is my gems file, you can pause this video and copy it as it is.
  39.  
  40. rails -v '2.3.8'
  41. hoe -v '2.8.0'
  42. highline -v '1.5.1'
  43. authlogic -v '>=2.1.2'
  44. authlogic-oid -v '1.0.4'
  45. activemerchant -v '1.5.1'
  46. activerecord-tableless -v '0.1.0'
  47. less -v '1.2.20'
  48. stringex -v '1.0.3'
  49. chronic -v '0.2.3'
  50. whenever -v '0.3.7'
  51. searchlogic -v '2.3.5'
  52. will_paginate -v '2.3.11'
  53. faker -v '0.3.1'
  54. paperclip -v '>=2.3.1.1'
  55. state_machine -v '0.8.0'
  56. aws-s3 -v '0.6.2'
  57. spree -v '0.11.0'
  58.  
  59. When you run rake gems:install, your terminal will install the gem aws-s3, since I've already installed it, nothing happened.
  60.  
  61. rake gems:install
  62.  
  63. rake db:bootstrap
  64.  
  65. Loading the sample data will take some time, so I'll choose 'no' for now.
  66.  
  67. If you haven't verified heroku and/or created an Amazon S3 account, let's do it first.
  68.  
  69. You can verify your account by clicking the 'Update billing info' link.
  70.  
  71. Create your Amazon S3 account. And create a bucket.
  72.  
  73. We will be using that bucket later, as well as the access keys.
  74.  
  75. You can get your access keys in the security credentials page.
  76.  
  77. now back to our app.
  78.  
  79. let's test our spree on our local machine
  80.  
  81. good.
  82.  
  83. moving on.
  84.  
  85. git init on your app folder
  86.  
  87. then create your heroku app.
  88.  
  89. heroku create <-app-name-> --stack bamboo-ree-1.8.7
  90.  
  91. include this addon in your app: "Piggyback SSL"
  92. (Again, you can only do this if you have a verified Heroku account.)
  93.  
  94. heroku addons:add "Piggyback SSL"
  95.  
  96.  
  97. git add .
  98. git commit -m "message"
  99. heroku db:push
  100.  
  101. pushing your database might take a while.
  102.  
  103. if you haven't verified your heroku account and/or created an amazon s3 account, you can do it now.
  104.  
  105. let's now push it to heroku (rails app)
  106.  
  107. be patient.
  108.  
  109. You can only have a successful push to heroku if you have the proper order of gems to be installed with your app.
  110.  
  111.  
  112. Success!
  113. We've pushed our rails app into heroku.
  114. But before everything else, we should configure our s3 keys.
  115.  
  116. you can do it by entering the following commands below:
  117.  
  118. For this step, I'll be doing it on my own.
  119.  
  120. heroku config:add S3_KEY=[your S3 access key]
  121. heroku config:add S3_SECRET=[your S3 secret]
  122. heroku config:add S3_BUCKET=[your S3 bucket]
  123.  
  124.  
  125. and we're done!!!
  126.  
  127. SUCCESS!!!
  128.  
  129. THANK YOU FOR WATCHING! :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement