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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:21:24+00:00 2026-05-28T03:21:24+00:00

I am using Rails 3 and have a need to run WEBrick with SSL

  • 0

I am using Rails 3 and have a need to run WEBrick with SSL support during development. To achieve this, I’ve followed this guide:

http://www.nearinfinity.com/blogs/chris_rohr/configuring_webrick_to_use_ssl.html

This works well, however, I want to ensure that these settings do no affect my rails application when run in production mode. We are currently using Apache/Passenger, and the project appears to still run fine. Is there a clean way, however, to make sure that this code isn’t even executed? I’m thinking a possible answer could be an if/end block around the code, or perhaps a built-in rails facility that allows development-only code to be placed in a separate file or something similar.

  • 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-05-28T03:21:25+00:00Added an answer on May 28, 2026 at 3:21 am

    Looks like ENV[‘RAILS_ENV’] is your friend. The ENV hash shows you the Unix environment the app is being run under and Rails itself will look at RAILS_ENV to decide in which mode to run. You could do something like this:

    if ENV['RAILS_ENV'].to_s == 'development' || ENV['RAILS_ENV'].to_s == ''
      # do your thing here
    end
    

    You can also make sure that you run webrick with that environment:

    #> RAILS_ENV=development /path/to/webrick/script
    

    Hope it helps.

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

Sidebar

Related Questions

We are using reverse-geocoding in a rails webservice, and have run into quota problems
I start developing a site using Rails 3.x and I need to run multiple
Using Rails v2.1, lets say you have an action for a controller that is
I'm using jQuery with rails and have the following piece of code $('#related').html(<%= render
I am using rails beta 3 and I have a erb page named index.html.erb
I have been using the Rails console a fair bit lately and its making
I using the Rails resource_controller plugin. I have a ReleasesController, which is nested within
I just started using CakePHP for a small project. I have rails experience, and
I have started using jQuery and rails. I have made a simple form that
I have a rails application that allows searches using longitude and latitude. I have

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.