Database.yml with environment from dotenv
Hello there,
Is it just me or is there an issue with RubyMine not loading the environment variables from the dotenv.
Everytime I open/restart RubyMine my settings are lost. I guess they are reloaded from database.yml
See attached screenshot:
My .env looks like this:
DB_PASS=awesome_sauce
DB_NAME=rms2
APPLICATION=both
Writing that values directly into the fields is working. But at the next start of RubyMine the configuration is lost.
Is there a known workaround?
Please sign in to leave a comment.
Hi,
RubyMine doesn't load .env, it uses environment you have when you run RubyMine.
Could you please clarify the situation you have. I'd expect that data soure should be kept untouched if a user creates one.
If RM does remove such data sources I'd consider this as a bug and tried to fix it.
Regards, Oleg.
Well that's ok, I could write it in my RubyMine startup environment. But as you can see the environment is not replaced. There's still the plain ERB-Syntax <%= ENV['DB_HOST'] %>.
That's exactly the case.They are not removed but replaced with what's in database.yml
Steps to reproduce:
1. Start RubyMine
2. Enter Data Sources (Host, DB, Username, Password)
3. Everything works as expected
4. Close RubyMine
5. Start RubyMine
6. Data Source has invalid values. So no access is possible. Settings look like in the first screen shot. If I open a table: "The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
java.net.UnknownHostException: <%= ENV['DB_HOST'] %>"
I think there are 2 issues here:
1. The ERB is not evaluated.
2. The user provided settings are not stored.
Ah, I've missed this. The configuration doesn't support erb :(
Oleg.
Is this point still valid?
Yes, this is what I'd espect as a user.
Regards, Oleg.
So just to follow up:
You would consider this a bug?
Are there any plans to fix this?
Oh and just for reference. Some one else had the problem, too: https://devnet.jetbrains.com/thread/460488
+1
I have the same problem. I think it's going to force me to choose between dotenv and RubyMine. I guess I'll choose RubyMine, but I'm kind of bummed about it.
So sad, nothing happens since then, even though
And should I mention that I'm a paying costumer?
+1
Have the same problem too.