Best practices for deploying Rails 3.2.x app to Heroku? - ruby-on-rails-3

Are there changes to the rails config files that are commonly made to boost performance before deploying most apps to production on Heroku? Curious after reading Nerian's answer to this question (summary: Heroku deployment issue solved by making "config.assets.compile = true" in config/environments/production).
Hope this isn't too general-- I'm a stack overflow newb as well. Thanks!

Related

Heroku: undefined method during migration (Rails 7 Api)

I created an API with Rails 7 and I have a problem when I try to migrate my data to Heroku with the command : heroku run rails db:migrate.
I have this error in my console :
NoMethodError
Everything seems to work fine locally, but I can't send my data to Heroku.
I don't quite understand why.. Here is the content of my gemfile:
Gemfile.rb
This is my first time asking a question on this platform, and I'm brand new to web development. I apologize in advance if you feel that you lack information to try to help me to solve my problem. Thanks in advance, have a good evening.
Problem solved. I had forgotten to communicate to Heroku my secret_key_base which was in my credentials.yml file ^^

Deploy a Ruby on Rails website

i would like to deploy my ruby on rails website. I am using rails 3.2 and ruby 1.9.3, so have the assets pipeline feature. What i would like to know is who offers the most complete hosting package ( or easiest as I am new to rails). I don't mind paying for a package or trying a free one, just as long as its idiot proof :).
Any advice helpful as I would like to get this uploaded for a client
Heroku is pretty much today's standard for deploying Rails app, if you are into paying for it.
I would personally recommend to deploy in your own server if possible. It's much more versatile and not difficult at all. You could also make the procedure more efficient by using a tool like capistrano, which i highly recommend.

Are there any performance/functionality differences between installing the New Relic RPM as a gem vs. as a Heroku add-on?

I am hosting my Rails 3 application on Heroku and would like to add New Relic monitoring.
I notice that Heroku has an add-on that I suppose sets everything up for you, but I also notice that it doesn't create a "real" New Relic account - instead, it creates a Heroku-specific New Relic account that you can only access through Heroku.
What I am curious about is: are there any differences in ...
Functionality
Mainly, does the Heroku-specific add-on offer any additional Heroku-specific features other than configuring the service for you? It seems to me that, if not, it might be better to use the gem so as to avoid any mysterious Heroku monkey-patching?
Configurability
Does only being able to access the New Relic account via Heroku have any downsides (other than the annoying Heroku header frame taking up the top of every screen)?
Performance
Does the Heroku set-up afford any performance benefits over self-installation of the gem?
Cost
It looks like the Heroku New Relic add-on charges by the dyno. Does this make it more or less expensive overall than a comparable plan directly through New Relic? If it's more expensive, does it have any features that justify the extra cost other than the simplified configuration?
Thanks all!
Functionality
AFAIK it does not add any functionality besides adjusting and viewing through Heroku.
Configurability
This is the biggest upside. Heroku is all about making things easier and with the plugin all you have to do is install it you are ready to go.
Performance
Heroku plugins are essentially heroku-gems that get pulled in somewhere along the line. We would need to research how the plugin was made; obviously if the plugin used something faster than ruby then it would probably be faster than the new-relic gem which is just made of ruby.
Cost
I do not think you are missing anything here. You will end up paying two parties, so whatever Heroku charges that is your extra cost being $0.06 dyno.

Thin vs. unicorn for development mode on Mac?

I'm shocked that this question hasn't been asked already, but I swear I looked everywhere. Are there advantages of thin over unicorn, or vice versa, when running Rails 3 in development mode?
I decided to go with Thin for development because Heroku runs my apps on Thin in production.
It's always a good practice to make your dev ENV match your production ENV as much as possible.
Here's a couple breakdowns of Thin vs. Unicorn, although they're a little old.
http://snaprails.tumblr.com/post/441654760/thin-vs-unicorn-performance-benchmark
http://cmelbye.github.com/2009/10/04/thin-vs-unicorn.html
Unicorn runs very well on Heroku now, you may want to check this out:
http://michaelvanrooijen.com/articles/2011/06/01-more-concurrency-on-a-single-heroku-dyno-with-the-new-celadon-cedar-stack/
And of course this to get a better idea of why you'd want to use Unicorn:
https://github.com/blog/517-unicorn
I'm moving away from Thin now myself after exploring this more fully.
**I should note, this is only possible on the Celadon Cedar stack, which should be something you're shifting towards at this point anyway.

Does Juggernaut work on Heroku?

I'm building a Rails app that includes live group chat. I've heard Juggernaut is the best option for this. Does it work on Heroku?
They did have experimental node.js support but it seems to be in closed beta for the timebeing. Expect a release soon.
http://blog.heroku.com/archives/2010/9/20/an_update_on_heroku_node_js_support/
I have minimal sysadmin skills but managed to set up an Ubuntu 10.04 environment with relative ease. http://purebreeze.com/2011/03/adding-realtime-push-updates-to-agileista-using-juggernaut/
The 'easiest' option is probably to use Pusher but probably not as fun or cost effective.
UPDATED
Heroku now fully support node.js
Here's a gist from the juggernaut author showing how he set up juggernaut on Heroku:
https://gist.github.com/1003748
I will also update my blog post shortly to reflect getting up and running.
It's much easier now!