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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:47:33+00:00 2026-06-15T07:47:33+00:00

app/controllers/app.rb require ‘sinatra’ get ‘/’ do erb :index end app/views/index.erb <html> <body> <p>Hello World</p>

  • 0

app/controllers/app.rb

require 'sinatra'
get '/' do
  erb :index
end

app/views/index.erb

<html>
    <body>
        <p>Hello World</p>
    </body>
</html>

Error:

Errno::ENOENT at /
No such file or directory - .../app/controllers/views/index.erb

How do I configure erb to look into app/views instead of app/controllers/views?

  • 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-15T07:47:34+00:00Added an answer on June 15, 2026 at 7:47 am

    You can achieve this by adjusting the configuration settings. Since you are using non-standard settings, you need to tell Sinatra what the actual root of your app is and where to find the views. At the top of your app/controllers/app.rb file add:

    # sets root as the parent-directory of the current file
    set :root, File.join(File.dirname(__FILE__), '..')
    # sets the view directory correctly
    set :views, Proc.new { File.join(root, "views") } 
    

    You can read more about Sinatra configuration options in the Sinatra Documentation.

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

Sidebar

Related Questions

Can I capture the following two routes in a single line? GET /game controllers.Main.app.gamelist
I have a strange behavior of Rails 3.0.10. Got this application controller: app/controllers/application_controller.rb require
While learning Rails, I found this example in the Sam Ruby's book: app/controllers/line_items_controller.rb def
I have an app with two view controllers. ViewControllerA is a blank view with
I have an app with a custom UITabBarController that contains five view controllers. Within
I am looking to build an app that has 6 view controllers laid out
I'm developing a Grails App. I have about 20 Controllers right now and there
Using Unity in an ASP.Net MVC 2 app I have various dependencies on Controllers
Ext.define('DigitalPaper.controller.Documents', { extend: 'Ext.app.Controller', views: ['Documents'], stores: ['Documents'], models: ['Documents'], init: function() { console.log('[OK]
I have a controller something like this: Ext.define('DigitalPaper.controller.Documents', { extend: 'Ext.app.Controller', views: ['Documents'], stores:

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.