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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:48:20+00:00 2026-05-27T07:48:20+00:00

How do I set up my twitter gem not to send tweets in my

  • 0

How do I set up my twitter gem not to send tweets in my dev and test environment?

Also I am using Heroku and I don’t know how to tell heroku which app is a test which is the prod …

I followed your tips and added this in my code:

      if Rails.env.staging? 
        Notifier.send_email(msg)
      elsif Rails.env.production?
        Twitter.update(msg)
      else
        logger.info "JOEL - #msg}"
        Notifier.send_email(msg)
      end

For whatever reason, although I set RACK_ENV= staging and created staging.rb in my environment folder … I still never managed to get Rails.env.staging? = true …

I am almost there, but not quite…

any tips,

Joel

  • 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-27T07:48:21+00:00Added an answer on May 27, 2026 at 7:48 am

    To add to Vibhu’s answer…

    You need to wrap the code in this

    if Rails.env.production?
      # Code here will only execute in your production environment
    end
    

    And then you need to specify a different environment on Heroku for your Heroku testing / dev server so it knows not to send anything on that specific Heroku server: http://devcenter.heroku.com/articles/multiple-environments

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

Sidebar

Related Questions

I am trying to track a set of keywords from Twitter by using the
I am using a twitter plugin that is being set with these options: jQuery(function($){
I'm using the twitter gem and it has a mistake in one the methods
How to set this SHKTwitterCallbackUrl through the Twitter Developer site ... I'm using the
I'm using the twitter gem located here... http://rubydoc.info/gems/twitter/2.0.2 I'm trying to use a method
I'm using a Queue in jQuery to bunch together a set of animations, $('#twitter').queue('myQueue',function(next){$('#titleTile').animate({top:
The location text from Twitter could be just about anything. Sometimes Twitter clients set
I am working with a java Twitter app (using Twitter4J api). I have created
I have successfully set up my twitter callback on my webpage and everything is
I'm developing a little Twitter application on iOS 5. I'm using Twitter and Accounts

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.