Combining Rails and React on same Heroku app - ruby-on-rails

I've recently deployed a ReactJS application on Heroku and everything went fine there.
But now I'm trying to deploy my RailsAPI app on there too, but everything I do I get errors, it's something with the git push that don't work.
He always says : hint: Updates were rejected because the tip of your current branch is behind
I suppose this is because there is already my ReactJS app on there? When I force push this happens :
App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz
How can I run ReactJS along with RailsAPI on the same Heroku app? I've been searching and read a few stackoverflow posts but I can't seem to find anything similar to this...
I followed some tutorials but I don't get how they do it.
I'm using 2 different folders (and 2 different git repos) for the projects, so RailsAPI is seperated from ReactJS
My buildpacks for this project :
=== neighborapp-oc Buildpack URLs
1. heroku/nodejs
2. heroku/ruby

I know this is old, but in my opinion there is no reason not to create two separate apps, and then just direct your rails API calls in your frontend to the URL created by the rails heroku app. It works well in my experience. :)

Related

Spree 2.1 deployment on Heroku

I am trying to deploy an ecomm site I am developing to Heroku.
I am using Rails 4, Spree 2.1 with the Spree_Fancy theme overtop that, S3 for images, and postgres as database in all environments.
The application is working perfectly on my local machine, but when I deployed it to Heroku, the front end breaks. The app runs via Heroku, but there is no styling at all, no theme, nothing. Just plain text and "no products found" message.
I expected there to be no images (since none had yet been uploaded to s3), but there were no products either, even though the db migrations ran.
Any ideas of what I am missing?
I've just answered on another thread the same problem scenario. Hope it helps.
Broken spree_fancy layout on heroku

Ruby on Rails not rendering views when downgrading from version 3 to 2

I am in the middle of putting up my Ruby on Rails app to a live server but have to downgrade from version 3 to 2 because that is all my shared hosting provider supports. I was able to adapt my models, controllers and routes without much problem. The problem I am having is with the views rendering.
I went through the process of creating a default layout for each controller as Rails 2 requires. When I run the app on the server, it starts just fine and the smokescreen index.html is visible but if I delete that and try to see the real app, all I get are broken links and files that are unable to load according to the browser.
I am sure this is an issue due to the downgrade. Any ideas on what I am doing wrong?
Doing a downgrade from Rails 3 to Rails 2 seems to me like a crazy thing to do for many reasons:
1) Rails 4 is already released. You should be looking to upgrade instead of downgrading.
2) There are many hosts out there that offer amazing services and even some free. Heroku is a great place to start if you don't want to manage your own server.
3) Rails 3 was almost a complete rewrite of the way Rails worked. This includes the addition of the Assets Pipeline which is a blessing in terms of development.
With that said, if you're still looking to downgrade, I would try to revert the steps found in many Upgrading Rails 2 to Rails 3 tutorials out there.
They are a bit long and many steps required to put here but a simple google search will yield many great resources. Here's a Railscasts http://railscasts.com/episodes/226-upgrading-to-rails-3-part-2

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.

github to heroku...Alreay exsistent application

I want to push my rails application from github to heroku. I have deployed my application on github and i have its url. I dont know how to deploy on heroku an application which already exists on github .
Anyone who knows please reply.Thanks
Heroku has an excellent Guide on deploying Rails 3 applications to Heroku.
You can now deploy, on Heroku, either the master branch or a feature branch from a github repo. This deployment can be done either manually or automatically (when something changes on the branch in the github repo). To make this happen, login in to Heroku, click on the app, and click the "Deploy" menu pick. Scroll down and you will see "Automatic" and "Manual" deploy choices. You can select one or both of these. A continuous integration tool -- like GoCD, Jenkins, or others -- would provide another layer of control and management for you. But this deployment method using just Heroku works well for individuals, small teams, or simple use cases.

Heroku App with a Wordpress Blog

I recently discovered that Heroku now allows PHP which means that a wordpress blog can be hosted on it. I also found this project template: https://github.com/mhoofman/wordpress-heroku
I have a ruby on rails app which is to be hosted on heroku with a domain www.mysite.com, and in that app, i need a way for www.mysite.com/blog to show the wordpress blog.
Can someone help me out, with details on how I can do this?
Whilst I've not used the new PHP platform I don't think what you're asking for is going to be possible.
When you deploy an application to Heroku it detects the type of application during the push process and sets up the application accordingly, Heroku use Apache to host PHP as you can see from the output in this post http://tjstein.com/2011/09/running-wordpress-on-heroku-and-amazon-rds/ - there's not been any mention of mixing platforms in a single application yet so would imagine that it's not supported.
The nearest you'd get is hosting your site and your blog in two seperate applications with the blog on blog.mysite.com and then put a redirect on www.mysite.com/blog to the blog.mysite.com url.
Im Still working on this
the closest to getting a solution is using the reverse proxy gem
see the answer here:
How can I use a subdirectory instead of a subdomain?

Resources