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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:22:21+00:00 2026-06-10T00:22:21+00:00

ENV[‘RAILS_ENV’] ||= development require File.dirname(__FILE__) + ‘/../../../config/boot’ require File.join(Rails.root, ‘config/environment’) This is the initial

  • 0
ENV['RAILS_ENV'] ||= "development"
require File.dirname(__FILE__) + '/../../../config/boot'
require File.join(Rails.root, 'config/environment')

This is the initial part of my rails application. Can anyone explain whats the purpose of these three lines?

  • 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-10T00:22:23+00:00Added an answer on June 10, 2026 at 12:22 am

    #!/usr/local/ruby-current/bin/ruby – a shebang comment which tells a Unix like system how to execute this file.

    ENV[‘RAILS_ENV’] ||= “development” – Checks whether the selected environment of work is a development environment. If not it will set the environment to development.

    Rails initialization process: In any application’s /public directory we can find three files namely dispatch.cgi, dispatch.fcgi, dispatch.rb. The way we configure the server to start up the rails process( as a CGI process, a fast CGI process or a Ruby process) determines which one of the three files will be executed. The dispatch file that’s executed will load the Rails environment and respond to requests from the web server by calling the dispatcher. boot.rb ensures that the Rails_Root environment variable has been set. If it hasn’t been done boot.rb will define it as the directory one level beneath /config. Once Rails_Root has been set it continues the process of loading up rails by checking the existence of a frozen rails environment in vendor/rails. If this folder exists, then boot.rb will require the Rails initializer from there. If we don’t have a local (frozen) copy of Rails, boot.rb will load the rubygems library and scan the environment.rb to see if a RAILS_GEM_VERSION is constant has been defined. If it has boot.rb will load the initializer for that defined version of Rails( and raise an error if that version of Rails does not exist on the system). If RAILS_GEM_VERSION is not defined,boot.rb will attempt to initialize the most recent version of Rails installed on the system.

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

Sidebar

Related Questions

I can't access env variables in the Rails console, while in the application they
Is it possible to access Rails.env inside Sass files? I'm trying to do it
My env: ruby-1.9.2-preview3; rails-3.0.0.beta3 class PostFather < ActiveRecord::Base def self.inherited(subclass) end end class Post
Can you use an env var expansion such as %APPDATA% in log4j.properties file? I
#! /usr/bin/env python import os import stat import sys class chkup: def set(file): filepermission
Since the paths.env file is not generated for Cucumber 1.1+, if for example if
I have KOHANA_ENV environment var set to DEVELOPMENT for example. Now there is a
My development env: Windows 7, TortoiseHg, ASP.NET 4.0/MVC3 Test branch: code on test server
Env: Visual Studio Warning Level is set to 4, Code in the only file
After deploying to production env' I receive only 404 - File Not Found. The

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.