I get the following error when running my Rails 4.1 project in production:
ActionView::Template::Error (no implicit conversion of Fixnum into String):
8: %meta{content: "", name: "description"}/
9: %meta{content: "", name: "author"}/
10: = stylesheet_link_tag 'application', media: 'all'
11: = csrf_meta_tags
12: %body
13: .header.navbar.navbar-inverse
14: = render 'layouts/header'
What doesn't make any sense to me is that everything works just fine in development, the error above really gives me no clue as to what is actually wrong(no specific line number) and nothing in the HAML template appears off to me.
I also get a similar error when the following code in my UsersController is run:
@user = User.last
Again, works just fine in development, but in production it tells me TypeError (no implicit conversion of Fixnum into String).
Am I overlooking something? I don't see anything that would need a type conversion.
Commenting out the last line I mentioned doesn't effect the other error.
I figured this out on my own.
The secret_key_base I made for production in secrets.yml only contained digits; apparently YAML(or Ruby's implementation of it) interprets this automatically as an integer, and the secret_key_base must be a string. Perhaps it's also necessary for the key base to be alphanumeric. I'm not sure.
I wish Rails just did a type conversion on secret_key_base so I didn't have to waste half my work day trying to root out the issue. At the very least, it would have been nice to have a relevant warning as opposed to a cryptic error that doesn't point me in any direction.