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 8940141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:58:14+00:00 2026-06-15T10:58:14+00:00

I have a problem running a Ruby on Rails application using Passenger. My application

  • 0

I have a problem running a Ruby on Rails application using Passenger. My application resides in the /Users/Glutexo/Práce/Bytek/Bytek directory, which you can see has a non-ASCII character in in (á). Even when I symlink it into another directory, e.g. /Library/WebServer/Documents/Bytek with all characters being US-ASCII, the problem is still there.

But when I create another Rails application physically in all US-ASCII path, like /Users/Glutexo/rails/pokus, it works: The application starts and runs normally through Passenger.

The error page I get when trying to run a Rails application residing in non-ASCII path says the following:

Error message:

invalid byte sequence in US-ASCII

Exception class:

ArgumentError

Backtrace:

0 | /Users/Glutexo/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/pathname.rb | 45 | in `=~’

The line in pathname.rb mentioned is in the following function:

# chop_basename(path) -> [pre-basename, basename] or nil
def chop_basename(path)
  base = File.basename(path)
  if /\A#{SEPARATOR_PAT}?\z/o =~ base # This is the line no. 45
    return nil
  else
    return path[0, path.rindex(base)], base
  end
end
private :chop_basename

Does anyone have any suggestion, how to convince Passenger to be able to run Ruby on Rails application even from a path containing non-ASCII characters?

Rails is version 3.2.2, Ruby is version 1.9.3-p125, Apache is version 2.2.21, Passenger is version 3.0.12.

Thanks in advance for any help!

  • 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-15T10:58:16+00:00Added an answer on June 15, 2026 at 10:58 am

    The solution to this problem is to add a ‘magic comment’ to your rails app source files. For example, at the beginning of a file that will encounter a non-ascii character, add the following:

    # encoding: utf-8
    

    There’s a useful gem out there to help you do this: https://github.com/m-ryan/magic_encoding

    To confirm this solution, I setup passenger with a rails app in a directory containing ‘Práce’ and got a similar error to you. I ran the magic_encoding gem’s ‘magic_encoding’ command in the root of my rails app. I restarted passenger and it seems to have done the trick. Hope that helps!

    See also: invalid multibyte char (US-ASCII) with Rails and Ruby 1.9

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

Sidebar

Related Questions

I have a problem with running js/jquery in my rails app. I have Ruby
I am running Ruby on Rails 3 and I have an application that makes
We have a ruby on rails application running on an Ubuntu Sever. When I
I have Three Questions 1.The Putty Problem I have a running rails application that
I have developed a Ruby on Rails application and successfully deployed on Weblogic using
I have the problem running executable .jar file. I've created a project which contains
I have a problem in running a new project which I downloaded from github.
Possible Duplicate: Can't convert String into integer in ruby/ruby-on-rails I'm running through a tutorial
I have the Ruby on Rails-based application Redmine (based on the BitNami redmine package)
I am running Ruby on Rails 3.2.2 from 3.1.0. I have the issue undefined

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.