Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8086417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:26:20+00:00 2026-06-05T18:26:20+00:00

I’ve been trying to consolidate two tutorials for hosting static sites: Deploying Rack-based Apps

  • 0

I’ve been trying to consolidate two tutorials for hosting static sites:

  • Deploying Rack-based Apps for the cedar stack
  • Static Sites with Ruby on Heroku/Bamboo

Basically I want to be able to do what you do in the old bamboo tutorial on the cedar stack. I can get the cedar tutorial to work, but when I try modify it to serve files I get an error.

I have had a look at the following post, but the github repo doesn’t seem to be up any longer and I can’t quite figure out where I’ve gone wrong.

When I try run the site locally as per the first tutorial, I get the following error:

martin@crunchbang:~/code/martinrichards.me$ rackup -p 9292 config.ru &
[2] 4065
martin@crunchbang:~/code/martinrichards.me$ /home/martin/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval':     /home/martin/code/martinrichards.me/config.ru:2: syntax error, unexpected tIDENTIFIER, expecting '}' (SyntaxError)
200, ... |env|"
...

I’ve put what I’ve got so far on Github, any help will be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:26:21+00:00Added an answer on June 5, 2026 at 6:26 pm

    Well, first, your config.ru is almost completely empty. Looks like you’re following the same site structure as the Heroku tutorial, so start with a config.ru like this:

    use Rack::Static, 
      :urls => ["/stylesheets", "/images"],
      :root => "public"
    
    run lambda { |env|
      [
        200, 
        {
          'Content-Type'  => 'text/html', 
          'Cache-Control' => 'public, max-age=86400' 
        },
        File.open('public/index.html', File::RDONLY)
      ]
    }
    

    Since you are on Cedar, it is helpful to use a Procfile to start up your processes. So add a file called Procfile (no extension) to your root, and put the following inside it:

    web: bundle exec rackup config.ru -p $PORT

    That should do it.

    If you want to use Sinatra, Heroku has a step-by-step tuturioal for Ruby sites on Cedar: https://devcenter.heroku.com/articles/ruby

    EDIT:

    As it turns out, you’re having line-endings problems in your config.ru. That’s why GitHub is not displaying the file correctly. Your line endings are ^M, which are DOS/Windows/Mac OS 9 line-endings. That’s why Ruby is throwing an error on line 2 – it’s the first line break. Not sure what text-editor you are using, but it probably supports changing line endings. Switch them Unix, and all should work fine. If you’re looking for a text editor that can do this, check out Sublime Text 2. The line-endings functionality is in the “View” menu.

    Since you are building a pure Rack app, you actually don’t need a Procfile, since the default Heroku Cedar buildpack will detect the config.ru for you. However, the Procfile comes in handy once you start using other frameworks (like Sinatra). Plus, if you are on a Mac, you can use Foreman to simulate Heroku’s spin-up process. Note that Profile is without an extension and with a capital “P”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.