Google Groups

Re: [fat-free-crm-dev:517] Heroku, Rails 3, Precompiled CSS


nathan.f77 Dec 8, 2011 10:08 PM
Posted in group: Fat Free CRM Developers
Hi,

I should also mention that I've added the 'unicorn' gem, because Heroku's cedar stack allows us to specify a web-server in our Procfile. Unicorn gives us more concurrency for a single Heroku dyno - so we can squeeze about 3 concurrent requests out of a free Heroku instance. You can read more details about this here: http://michaelvanrooijen.com/articles/2011/06/01-more-concurrency-on-a-single-heroku-dyno-with-the-new-celadon-cedar-stack/


Regards,
Nathan B


On Fri, Dec 9, 2011 at 12:20 PM, Nathan Broadbent <natha...@gmail.com> wrote:
Hi Rob,

Sorry it's taken a while to get back to you. I've figured out the problem with Heroku and have updated the README. This issue has happened because we have made the upgrade to Rails 3.1, so please bear with us as we iron out problems like this.

Heroku has multiple platforms, called 'stacks'. Your app has been created on the 'bamboo' stack, but this stack does not have full support for Rails 3.1, which we have recently updated to. 
However, Heroku has a new stack called 'cedar', and this stack automatically precompiles assets whenever you deploy.

Unfortunately, at the moment you cannot migrate your app from 'bamboo' to 'cedar'. So if you want to run the Rails 3.1 Fat Free CRM on the new cedar stack, you will need to pull your database to your local machine, create a new application using the cedar stack (follow the updated README), and then push your locally saved database to the new application. You can follow this blog post for details on how to push and pull databases: http://blog.heroku.com/archives/2009/3/18/push_and_pull_databases_to_and_from_heroku

Also note that I have added a 'Procfile' to the master branch of Fat Free CRM, since the cedar stack requires this. However, if you want to stay on the bamboo stack for now, there is a way. You will need to delete this 'Procfile', since the bamboo stack will complain otherwise. You also need to run the assets:precompile task locally, and then commit the generated assets (stylesheets, javascripts, etc.). See this page for more info: http://devcenter.heroku.com/articles/rails31_heroku_cedar


I hope that wasn't too much information to process. Please do let me know if you have any problems, or if I need to clarify any of these details.


> Also, I think it might be helpful to include a list of known limitations with Heroku.  For example, can we send email notifications?
> Can we use avatars?  I'm both asking for myself because I'm not sure yet, and also so it can be included in the documentation.  :)  

As I mentioned above, the 'cedar' stack overcomes the limitation of a read-only filesystem by pre-compiling your stylesheets and javascripts whenever you deploy code.
You can send email notifications using the free SendGrid addon. (I haven't tested this yet, but we could add instructions to the documentation.)
Avatars cannot be uploaded, since Heroku apps are deployed to a read-only filesystem. There is a way to store uploaded files in Amazon S3, but I don't have an account to test / support this. I don't know if it's too important though, since gravatars will still be looked up from the user's/contact's email address.



Best regards,
Nathan B


On Wed, Nov 30, 2011 at 5:28 AM, rob <rob...@gmail.com> wrote:
I just tried to deploy FFCRM to Heroku again since the documentation has been updated to include the "HEROKU=true" config parameter.  Unfortunately, I'm getting the following error:

2011-11-29T21:07:15+00:00 app[web.1]: ActionView::Template::Error (screen.css isn't precompiled):
2011-11-29T21:07:15+00:00 app[web.1]:     10:     = javascript_include_tag :defaults, :cache => "cache/all"
2011-11-29T21:07:15+00:00 app[web.1]:   app/views/layouts/500.html.haml:9:in `_app_views_layouts_____html_haml__3973459948400657075_49938260'

I know, a while back, I posted about some find and replace hack I did to get things working on Heroku.  Anyone know if this is still required?  Is the documentation missing a step?  

Also, I think it might be helpful to include a list of known limitations with Heroku.  For example, can we send email notifications?  Can we use avatars?  I'm both asking for myself because I'm not sure yet, and also so it can be included in the documentation.  :)  

Thanks,
Rob

--
You received this message because you are subscribed to the Google Groups "Fat Free CRM Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/fat-free-crm-dev/-/FNd0CZCcXjQJ.
To post to this group, send email to fat-free...@googlegroups.com.
To unsubscribe from this group, send email to fat-free-crm-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fat-free-crm-dev?hl=en.