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

  • SEARCH
  • Home
  • 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 8388779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:32:49+00:00 2026-06-09T18:32:49+00:00

I am using Sinatra to build an app. The app runs just fine except

  • 0

I am using Sinatra to build an app. The app runs just fine except for when I recently added an element to an array that has special characters (Yóü).

@peeps = ["Joe", "James", "Phil", "Jane", "Yóü"]

I use this array for a number of things, though I’m not sure I need to include them in this post. When I run my app, I get the following eror in my browser:

Internal Server Error: invalid byte sequence in US-ASCII

In my terminal window, I see the following after I run ruby app.rb

app.rb:34: invalid multibyte char (US-ASCII)
app.rb:34: invalid multibyte char (US-ASCII)
app.rb:34: syntax error, unexpected $end, expecting ']'

Also, for what it’s worth, I typically use shotgun to run my server since I can make changes and just refresh the page. That is displaying this error when I run shotgun app.rb

[2012-08-16 21:36:37] ERROR ArgumentError: invalid byte sequence in US-ASCII
    /Users/me/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rack-1.4.1/lib/rack/utils.rb:182:in `gsub'
    /Users/me/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rack-1.4.1/lib/rack/utils.rb:182:in `escape_html'
    /Users/me/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/shotgun-0.9/lib/shotgun/loader.rb:76:in `format_error'
    /Users/me/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/shotgun-0.9/lib/shotgun/loader.rb:52:in `proceed_as_parent'
    /Users/me/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/shotgun-0.9/lib/shotgun/loader.rb:28:in `call!'
    /Users/me/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/shotgun-0.9/lib/shotgun/loader.rb:18:in `call'
    /Users/me/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/shotgun-0.9/lib/shotgun/favicon.rb:12:in `call'
    /Users/me/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/shotgun-0.9/lib/shotgun/static.rb:14:in `call'
    /Users/me/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rack-1.4.1/lib/rack/builder.rb:134:in `call'
    /Users/me/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
    /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
    /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
    /Users/me/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
  • 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-09T18:32:50+00:00Added an answer on June 9, 2026 at 6:32 pm

    You haven’t posted all your code, but you probably need to mark your file as being UTF-8, which you can do with a ‘magic comment’ at the top:

    # encoding: utf-8
    

    Here’s a good explanation of this issue.

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

Sidebar

Related Questions

I'm trying to build an app using Sinatra, Ruby, rack, haml, pony and SendGrid,
I've just started writing a reasonably straightforward site using sinatra. My problem is that
I have a portfolio web app that is run on Sinatra using pjax .
I'm trying to build [Ryan Bates' authenticaion from scratch][1] using sinatra but authentication does
I am using Sinatra for my webapp. I have some cleanup code that I
I'm very new to Ruby and using Sinatra, mainly so that I can do
I am working on a simple budget app using Sinatra and DataMapper in Ruby.
I'm using Sinatra and a client-side template called Dust.js (akin to Mustache) to build
I wrote a webform using Sinatra and Haml that will be used to call
Using the Sinatra library, I'm trying to condense two functions that display HTML code

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.