Serve on Heroku

258 views
Skip to first unread message

Tom Brooke

unread,
Jul 7, 2011, 10:39:16 AM7/7/11
to serve...@googlegroups.com
Serve would be great on Heroku but I know that Heroku is read only and some and caching can be a problem especially with SASS.

Is Serve Herokuable out of the box?

Tom Brooke

John Long

unread,
Jul 7, 2011, 11:12:38 AM7/7/11
to serve...@googlegroups.com
As of Serve 1.1 if you generate a structured Serve app with `serve
create` it will create the following config.ru:

https://github.com/jlong/serve/blob/master/lib/serve/templates/config.ru

If you look at line 14, there is a conditional there that checks for
the production environment and turns off Sass compilation. As long as
you test the Sass on your local box before deploying (forcing
compilation) and check the generated CSS into your repo (recommended),
it should deploy beautifully to Heroku.

--
John Long
http://wiseheartdesign.com

> --
> Serve Users Group
> Mailing List: http://groups.google.com/group/serve-users/
> Project: http://github.com/jlong/serve/
>

Ryan

unread,
Jul 21, 2012, 2:27:58 PM7/21/12
to serve...@googlegroups.com
Hi

I just tried to deploy a serve project to heroku, but haven't been successful.  I got passed my first error by changing the first line of the generated config.ru (link below) and set the port to the environmental variable ($PORT).  After I got that error resolved, I got stuck with this one (from the Heroku log).  I tried creating a brand new serve project, making the same port modification and got the same thing. 

/usr/local/lib/ruby/1.9.1/webrick/utils.rb:63:in `getaddrinfo': getaddrinfo: Servname not supported for ai_socktype (SocketError)

Here's the full code.

Config.ru - https://gist.github.com/3156643
Heroku Error - https://gist.github.com/3156573

Any ideas?

Thanks!
Ryan


On Thursday, July 7, 2011 8:12:38 AM UTC-7, John Long wrote:
As of Serve 1.1 if you generate a structured Serve app with `serve
create` it will create the following config.ru:

https://github.com/jlong/serve/blob/master/lib/serve/templates/config.ru

If you look at line 14, there is a conditional there that checks for
the production environment and turns off Sass compilation. As long as
you test the Sass on your local box before deploying (forcing
compilation) and check the generated CSS into your repo (recommended),
it should deploy beautifully to Heroku.

--
John Long
http://wiseheartdesign.com

Jess Brown

unread,
Jul 21, 2012, 3:52:00 PM7/21/12
to serve...@googlegroups.com
Hi Ryan,

I'm surprised to see webrick errors in your heroku logs.  

I've never had to change anything to deploy to heroku.  Can you run the app locally?  Are you using bundle locally?

If you're bundling locally, and running the app locally without difficulty, and are committing everything to git, then it should run out of the box.  

If you're doing all that and still having problems, you may try to add gem 'thin' to your gem file, bundle install and try running locally (use "thin start" instead of "serve"), then pushing to heroku.  Heroku uses thin to run rack apps.  

If you're still having problem, let me know, I can do a quick screen cast for you.

Jess Brown
Brown Web Design

Ryan

unread,
Jul 21, 2012, 10:11:52 PM7/21/12
to serve...@googlegroups.com
Hey Jess.

Yes, I was able to run locally and bundle locally with no problems at all. Took your advice and add thin to my Gemfile and everything worked like a charm--both on my original project and the fresh one I generated as a test.  I hate not knowing what the issue was, but this gets me to where I need to be fore now.  Thanks a million for your reply!

Best,
Ryan

Kyle Bradshaw

unread,
Nov 3, 2012, 9:08:41 AM11/3/12
to serve...@googlegroups.com
I'm having problems serving with Heroku out of the box as well, I'm getting an error saying that serve is bound to port 4000 and it's dumping out.

Any ideas? (New at this)

Kyle Bradshaw

unread,
Nov 3, 2012, 10:00:34 AM11/3/12
to serve...@googlegroups.com
so I fixed the situation by removing
#\ -p 4000
from my config.ru file.
not sure if this is proper procedure or not.

did I do it right?

Joel Oliveira

unread,
Nov 3, 2012, 10:06:58 AM11/3/12
to serve...@googlegroups.com, serve...@googlegroups.com
Yup that would certainly do it!

Sent from my iPhone
--

Jess Brown

unread,
Nov 3, 2012, 10:33:26 AM11/3/12
to serve...@googlegroups.com
You can also add 

gem "thin" 

to your gemfile. Run bundle. I think that would be the preferred way. 


--

Kyle Bradshaw

unread,
Nov 7, 2012, 9:28:26 AM11/7/12
to serve...@googlegroups.com
Hey Joel guess who will be at Thoughtbot tonight for the ROR training session?

Kyle Bradshaw

unread,
Nov 7, 2012, 9:29:20 AM11/7/12
to serve...@googlegroups.com
Thanks Jess, I've made the gem change, also switched to the edge Serve and no longer getting those deprecation warnings. Things are working well!

Joel Oliveira

unread,
Nov 7, 2012, 9:41:56 AM11/7/12
to serve...@googlegroups.com
Heeeyyyy mi casa su casa! Enjoy, Kyle! :D

Sent from my iPhone

Jake Rayson

unread,
Aug 5, 2013, 8:03:39 AM8/5/13
to serve...@googlegroups.com
As long as you test the Sass on your local box before deploying (forcing
compilation) and check the generated CSS into your repo (recommended),
it should deploy beautifully to Heroku.

Everything works fine for me locally but having problems with Heroku:

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

I'm using the thin server gem 'slim' and additionally using Slim templating and Sass globbing. I've tried temporarily disabling compass and sass-globbing but still no joy.

Full heroku error message here: https://gist.github.com/growdigital/6155329

Anyone any ideas where I can look next?

Jake Rayson

unread,
Aug 5, 2013, 9:46:10 AM8/5/13
to serve...@googlegroups.com
FWIW, have tried default Serve project on Heroku, only changing server to thin with `gem 'thin'`. Still getting an error.


Running on US Cedar stack, on Ruby/Rack framework.

John W. Long

unread,
Aug 5, 2013, 9:53:10 AM8/5/13
to serve...@googlegroups.com
I'm afraid it's been a while since I've deployed Serve on Heroku. They keep changing their setup so it's hard to keep up with how to do it properly. Here's my latest example project: 


It's been a while though since I deployed it there, so no guarantees. Hopefully it's useful to you.

--John

--
--
Serve Users Group
Mailing List: http://groups.google.com/group/serve-users/
Project: http://github.com/jlong/serve/
 
---
You received this message because you are subscribed to the Google Groups "Serve Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to serve-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jake Rayson

unread,
Aug 5, 2013, 10:13:29 AM8/5/13
to serve...@googlegroups.com
> It's been a while though since I deployed it there, so no guarantees. Hopefully it's useful to you.

Thank you, will give it a go!

Can you recommend a host for Serve? Not really fussed, just want to
get the prototype out there. Heck, will even pay money ;)

cheers, Jake
> You received this message because you are subscribed to a topic in the
> Google Groups "Serve Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/serve-users/cjEQ5-zNbtI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
--
[~] Jake Rayson
[m] 07802 535 321
[e] ja...@growdigital.org
[w] www.jrayson.co.uk
[t] @growdigital

John W. Long

unread,
Aug 5, 2013, 10:24:36 AM8/5/13
to serve...@googlegroups.com
The easiest thing is to export the project and using something like Rsync to deploy. This is what I do for Serve's website:


This allows me to:

    rake website:deploy

Although sometimes the export command can be a little finicky if you are doing more than basic stuff (it's still experimental).

--John

Jake Rayson

unread,
Aug 5, 2013, 10:34:18 AM8/5/13
to serve...@googlegroups.com
> Although sometimes the export command can be a little finicky if you are doing more than basic stuff (it's still experimental).

I tried out the export, but alas the Slim templates are outputted with
.slim extension! Have created a new issue on github.

Will try AN Other ruby host, see how I get along :)

Jake Rayson

unread,
Aug 6, 2013, 5:18:32 AM8/6/13
to serve...@googlegroups.com
On 5 August 2013 14:53, John W. Long <m...@johnwlong.com> wrote:
> It's been a while though since I deployed it there, so no guarantees.
> Hopefully it's useful to you.

The good news is that your Serve test site is still running at
http://serve-demo.heroku.com/welcome

The bad news is that when I try duplicating the site, I'm ending up
with a stack of errors: https://gist.github.com/growdigital/6162857

I'll keep on with trying out other hosts.

cheers, Jake

Jake Rayson

unread,
Aug 6, 2013, 7:46:03 AM8/6/13
to serve...@googlegroups.com
More good news, Serve works fine on Engine Yard.

More bad news. Basic cost is $40 per month!

Jake Rayson

unread,
Aug 8, 2013, 5:13:28 PM8/8/13
to serve...@googlegroups.com
On Monday, 5 August 2013, John W. Long wrote:
> I'm afraid it's been a while since I've deployed Serve on Heroku. They keep changing their setup so it's hard to keep up with how to do it properly.

I've contacted Heroku support, and they've suggested that Serve may have trouble running on newer versions of Ruby. 

> Here is an example, according to your output:
>> Aug 06 01:52:35 serve-heroku app/web.1: 
>> /app/vendor/bundle/ruby/2.0.0/gems/ffi-1.0.9/lib/ffi/platform.rb:27:in `<module:Platform>': Use RbConfig instead of obsolete and deprecated Config.

>If this gives you any idea as to what I'm talking about, that implementation is using ffi v1.0.9. The ffi gem is up to v1.9.0!

I'm keen to get Serve running on Heroku, as I find their interface easy to use, plus they are very low cost for prototype sites.

Is there any way I can help with updating Serve? I've rudimentary Ruby knowledge but if someone points me in the direction of things to do and stuff to read, I don't mind getting stuck in.

Richard Metzler

unread,
Aug 11, 2013, 1:16:24 PM8/11/13
to serve...@googlegroups.com
If you want to host the static pages after `serve export` you could host them on Amazon S3.
You also can use your own domain on S3. See
http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html

Richard

Jake Subs

unread,
Aug 12, 2013, 3:07:31 AM8/12/13
to serve...@googlegroups.com
That is very handy to know, thank you :)
--
--
Serve Users Group
Mailing List: http://groups.google.com/group/serve-users/
Project: http://github.com/jlong/serve/
 
---
You received this message because you are subscribed to a topic in the Google Groups "Serve Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/serve-users/cjEQ5-zNbtI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to serve-users...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
[~] Jake Rayson
[w] www.jrayson.co.uk
[e] su...@growdigital.org
[t] @growdigital

Reply all
Reply to author
Forward
0 new messages