开发者

Rails 3.1 on heroku worth it?

开发者 https://www.devze.com 2023-04-07 10:39 出处:网络
I just upgraded my project to rails 3.1 since I saw the sass feature and the moving of public folder files to the assets folder and considered these major changes I should adjust to, especially the sa

I just upgraded my project to rails 3.1 since I saw the sass feature and the moving of public folder files to the assets folder and considered these major changes I should adjust to, especially the sass feature which is pretty cool.

however, when looking at heroku, i came across this post detailing what to do to get rails 3.1 working on heroku: http://devcenter.heroku.com/articles/rails31_heroku_cedar#getting_started

my app hasn't launched yet but I do intend to be on heroku and from the 开发者_如何转开发looks of that document, getting rails 3.1 to run on heroku sounds a little messy, where the assets folder is being created in the public folder.. when it has its own place now in 3.1.

what are everyone else's thoughts on this? i like to keep my code clean and am thinking if I should go back to rails 3.0.

maybe I missed something or a useful reason for doing this here, or am not interpreting this right, because this public folder precompile thing sounds so redundant to me.

In short, is having Rails 3.1 on Heroku good? Or should I go back to Rails 3.0


The asset pipeline is not required, and you can simply not use it if you don't want to.

Definitely keep Rails 3.1 for your app. You will have a much easier time upgrading for things you like in the future, and will have better security updates as the older versions eventually won't be maintained.

I'd recommend using the asset pipeline, and you can read more about it in the guide. http://guides.rubyonrails.org/asset_pipeline.html

If you don't want to use it though in your config/application.rb file change:

config.assets.enabled = true

to

config.assets.enabled = false

You'll probably also want to remove the assets gem group from your Gemfile as well.


Having your assets compiled into public is nothing to worry about. This is a sensible idea as you don't want to have to recompile your assets for every request.

Rails 3.1 has a number of advantages, however ultimately it's your decision, but I certainly wouldn't be fretting about asset compilation.


If youre app if using Jquery-UI (jquery being the new default in 3.1) then for sure just disable the asset pipeline and use 3.1. asset pipeline breaks jquery-ui anyway.

0

精彩评论

暂无评论...
验证码 换一张
取 消