Closed tdeo closed 3 years ago
Hi @tdeo, we removed ERB support to increase portability in https://github.com/thoughtbot/parity/commit/5704201d5bb7d8730e39e8f2767ae7964193a69d. PR #182 brings back some configuration support, but parsing ERB would require us to include an ERB gem and we've found that Travelling Ruby and Bundler don't play well together due a Bundler issue that will never be fixed.
I'd love to support configurability here, so if you have any ideas and can contribute a PR it would plug a major functionality gap for us.
Actually, erb
is part of the ruby stdlib (at least in c-ruby), and while it's true that basic interpolation in database.yml like the one that appears in a rails scaffold:
default:
url: <%= ENV['DATABASE_URL'] %>
is compatible with plain-yaml parsing, any interpolation outside a text value will break yaml loading.
Is re-including erb
from the stdlib out of the question, even without reintroducing bundler and gems ? I'm really not familiar with Travelling Ruby and unsure what's included
This is good news! If this is possible without adding any gems via Bundler (looks like that PR also removed git support, which might have been why I was wrong about ERB), then I don't see a reason why we can't do it.
Take a peek at #182, we'll want to be careful about making sure that solution and whatever happens here don't fall into conflict.
Thanks for figuring this out.
Help us track down and resolve parity problems faster with this template.
What command did you execute?
development restore-from production
What did you expect to happen?
I expected the command to succeed
What actually happened?
It failed with the following message :
It seems that parity fails to load my
config/database.yml
file because I have ERB syntax in it, which is supported by rails even though the extension is not.yml.erb
, here is a sample of it:The file is loaded properly by rails, it seems like parity should load the file using
ERB
instead of plain yamlSome information about your installation
which development
,which staging
,which production
? Parity has had multiple installation channels, and it's not uncommon for an old version to be somewhere else in your path.brew list parity
output?N/A
N/A
I installed parity via
apt