How can I install Braintree on a Heroku Ruby server? - ruby-on-rails

I am very new to Heroku and I don't have experience with ruby. I am trying to make my online server generate a token for my mobile client. I have also a created a Sandbox account. I am following the the tutorial in the below link:
https://developers.braintreepayments.com/start/hello-server/ruby
Keep in mind I'm new to this and I have no idea what I should do. In the below picture, is says add the following code to my project. What project? Where is this project? And how can I upload it to Heroku after I added the below code?
Can someone explain or send me a link to dummy it down for me (a lot) so I can understand how I can install Braintree on Swift using Heroku? Possibly a with images so I can understand better. I also need to know how I can tell my Xcode app to send tokens to my Heroku server to process them. I have been stuck on this task for a few weeks now and I still don't have any idea what I'm doing. Any help would be greatly appreciated.

You need to only add the gem to your gemfile locally. When you commit to heroku it will install the gem on the server by itself
Braintree has decent documentation on how to add the gem.
Those variables go in your environment.rb
Documentation: https://github.com/lyang/braintree-rails/wiki

Related

Private pub on heroku

I am developing a chat application using rails 3.2.12 and a great gem called private pub, for which you can find a screencast here. It is built on top of faye and enables you to easily build real time chats by pushing messages.
Now, deploying it on heroku actually is not that simple with private pub. Apparently, you have to set up another app for the faye channel and then subscribe to that channel from your other app.
This is all very confusing. Neither private pub nor faye have anything about deployment on heroku in their documentation. I have found these two links:
Private Pub on Heroku | Rails 3
http://webprogramming29.wordpress.com/2013/02/15/setup-privatepub-or-faye-on-heroku/
However, I don't really understand them since they start at a more advanced level.
Has anyone of you ever deployed a private pub/faye app on heroku and can give a step by step guide? Thanks!
You can checkout my sample chat at github https://github.com/Hareramrai/batkaro.
You can also checkout private_pub server code at github https://github.com/Hareramrai/fayeserver .
If someone is looking for a more up to date answer, I just released a gem that enables real time behavior in a Rails app:
https://github.com/dchacke/entangled
It sounds like, from the articles that you linked, that you need to have two web processes running. One for the normal web server, and one for the Faye server.
It may be easier to have two Heroku apps rather than trying to get each running within the same app.

How to deploy stage server in Rails and Heroku

My Rails app is hosted on Heroku. I would like to have another server for staging (i.e., showing and testing new features) before updating my main app.
I have no idea how to do this in general, and in Rails.
How should I go about it? Do I need to create entirely new app, Git repository, Heroku server etc.?
What would be the most popular Gem for this kind of job? (I hear a lot about Caspitrano, but I don't know how it helps in context of Heroku).
Thank you very much for your help.
Heroku documentation is covered this case. You just need create another branch for staging.
Check it https://devcenter.heroku.com/articles/multiple-environments

How do you remove a Ruby on Rails app from a production server?

I'd like to replace our existing Ruby on Rails application with a new version of the site in PHP, but I'm not sure how to remove the rails app from our shared VPS server.
Is there a way to delete the app via FTP or some way to remove it in Cpanel? The developers set it up to use a custom deployment script. Are there any typical uninstall scripts that might remove it?
Ideally, I'd like to avoid completely re-provisioning the server instance because I don't want to lose our blog database and email accounts.
Sorry for such a dumb noob question, but I'd really be grateful for some advice.
Thanks so much!
If its on linux, it should be at /var/www. Remove the database entries and put the PHP versions there too.

What is absolutely the easiest way to create and publish a Rails 3.0 application from Windows?

In an attempt to reach programming enlightenment, I'm trying to build my latest website within the Rails ecosystem. I'm finding this very hard going as a .Net developer and need a push in the right direction as I'm on the verge of giving up and going back to what I know.
I've got something approaching a prototype going in Rails, and have been trying to figure out how to get to the point where I have a sensible deployment set-up to publish a beta of this thing. I don't see any point in developing any further until I know I'll be able to publish in a sensible fashion.
So far, I have signed up for hosting at HostingRails, created an SVN repository at Google Code and installed Capistrano. The problem I'm now facing is that I have no idea how to alter my Capfile and Deploy.rb to get these talking to each other, and that's before I've even thought about database deployment. The problem is that the tutorials on the hosting provider aren't great and the documentation for Capistrano goes straight over my head. I'm at a point where Capistrano presents me with a password prompt, and no password relating to anything I know of seems to work. Capistrano doesn't give me a hint of what it's trying to do, and I have no idea how to verify any of the lines in my config file to find out what's wrong.
Can anyone suggest a complete toolchain that will allow me to publish an application with as little configuration as possible? Am I going in vaguely the right direction and will this also give me sensible DB deployment options? Can anyone suggest a simple step-by-step guide which doesn't require an understanding of 37 separate gems before deployment is possible?
I would suggest git and heroku for rails projects rather than svn and HostingRails. msysgit works well on Windows, and I just started using heroku and it's as easy as installing the heroku gem and doing "git push heroku master".

HTTP Push on Heroku

What would be the best approach to creating an application on Heroku that has the capability to push data to the client?
I have looked at Juggernaut; however, it requires Flash and I am not sure about it actually running on Heroku.
Any help would be appreciated.
although I'm not using Heroku personally, they've just announced experimental node js support few days ago. While they are working on it, you might want to explore Node.js and Websockets in the meantime:
http://devthought.com/blog/2009/12/nodejs-and-the-websocket-protocol/
Yes juggernaut is not supported by heroku. I guess you should get in touch with the heroku guys for this. Unless and until heroku doesn't make it an addon package you won't be able to use juggernaut.

Resources