3

Everything works fine on my local server but I'm getting this error message when I try to perform a function after uploading the website into production on heroku.

On heroku, everything works fine EXCEPT when a user tries to post a content. It's a simple text form with a post button. I seem to only get this We're sorry, but something went wrong error when the # of text exceeds 2 or 3 lines or something. It's a bit random in that everything that is 2 lines or shorter post fine, but when it gets to 2-3 lines, not all go through. When it's over 3, they definitely don't go through.

Anyone know what could be causing this weird error? As I mentioned, all short text posts work just fine but I start getting this error message the longer the text posts get (like exceeding 2 lines in my text box)

Prakash Murthy
  • 12,923
  • 3
  • 46
  • 74
syk
  • 211
  • 4
  • 14

1 Answers1

5

Most likely the error is because the field you're trying to input is a string field. Heroku uses pg which limits the length of string to 255 characters. You need to change your model to use text fields instead when the input will be long.

You can always look at your logs by doing:

heroku logs

and read more information on the error.

Richard Brown
  • 11,346
  • 4
  • 32
  • 43
  • Thanks, do you know if there's an easy way to change the input type for the module from a string to a text? I'm still in the process of learning programming... – syk Mar 09 '13 at 00:50
  • See this post: http://stackoverflow.com/questions/2799774/rails-migration-for-change-column Basically you create a migration that will alter the field type from :string to :text. – Richard Brown Mar 09 '13 at 00:51