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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:12:52+00:00 2026-05-27T04:12:52+00:00

On my local server (rails & MySQL) I can run a simple search like

  • 0

On my local server (rails & MySQL) I can run a simple search like this:

      find(:all, :conditions => ['name LIKE ?', "%#{search}%"])

Where I pass in the search parameter and it tries to match that to the name field in a particular model. However, I get no results in my application on heroku, and in the heroku console i also get no results.

I know heroku doesn’t run MySQL, can anyone explain why this doesn’t work and the simplest way around it.

UPDATE:
After playing around and some research (now that I knew where to look), LIKE in MySQL is not case-sensitive. It still works on heroku, but was throwing me off because it is case-sensitive. ILIKE is solution for deployment on heroku.

  • 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-27T04:12:53+00:00Added an answer on May 27, 2026 at 4:12 am

    I would really suggest running Postgres locally if you’re deploying to Heroku. No matter how good your code and tests, if you’re deploying to a different stack you’re going to see all sorts of problems.

    In PG land, you’ll need this:

    find(:all, :conditions => ['name ILIKE ?', "%#{search}%"])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) I have a Rails
When I run 'rails server' I get the following error: Could not find gem
Every time I run this command rails server : warning: Insecure world writable dir
Our MQ service will be moved to outside of local server. I can see
I had no problem at all running the following code on a local server,
I have a number of Rails 3.1 applications running on a local server, remote
I have troubles to push my rails app on heroku. In my local server,
I'm trying initialize my local rails server but I haven't been able to, because
I've been struggling with this for some time now and I just can't find
I need to test HTTPS connections to my local Rails script/server instance in development

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.