Comments (6)
Seems like there is a problem with the environment variable configuration of the dev env.
What's you get when you print RAILS_ENV environment variable in shell? echo $RAILS_ENV
.
from black_candy.
It's production
. I'm not very familiar with nix, but I don't see this configured in the shell.nix
file - is it coming from the tarball that shell.nix
is referencing?
from black_candy.
This shell.nix file doesn't set RAILS_ENV. Do you set a global RAILS_ENV on your environment? When you out the nix shell, what value are you get form RAILS_ENV. Can you try to run nix-shell --pure
to see value of RAILS_ENV environment?
from black_candy.
Do you set a global RAILS_ENV on your environment?
No, I don't, echo $RAILS_ENV
is blank when I'm not in nix, which is why I thought it was being set by nix somewhere.
nix-shell --pure
still has RAILS_ENV as production:
❯ echo $RAILS_ENV
❯ nix-shell --pure
[nix-shell:~/code/black_candy]$ echo $RAILS_ENV
production
from black_candy.
As previously mentioned, you can set rails env on command to avoid the RAILS_ENV issue RAILS_ENV=development rails db:setup
. But still got error from database. That's because the database wasn't running yet. It's a bit tricky. Because nix-shell can not auto run service, So when you first time to setup database, you should manually run postgres in nix-shell first, like this postgres
. Then launch a new terminal instance to run 'RAILS_ENV=development rails db:setup'. When the database setup is complete, now you can stop the running postgres. Because I have already config the postgres and redis service on Procfile.dev, so you don't have to manually run those services . And use ./bin/dev
to run those services.
So the thing is when you first time setup database use nix, you should manually run postgres before it.
I should update the nix dev setup Instructions for this.
from black_candy.
I figured out that I had Postgres running already, which prevented Postgres from starting inside the nix shell. I wasn't clear that the nix environment is not completely separate from the host environment.
from black_candy.
Related Issues (20)
- Can't check if the formate is lossless or not when the formate use general container
- rename artis, albums HOT 1
- Error response from daemon: Conflict. The container name "/blackcandy_app" is already in use by container XXX HOT 4
- Add version number on settings page
- Player timer is frozen after switching to another page
- Add playlists in search results
- Option to move playlist to the Albums, Artist, etc. bar HOT 2
- Collapsible sidebar player
- Song requests returning 403
- When delete the last song from current playlist, page will redirect to blank page
- The db:seed task will run every time when has restarted the docker container
- Responsive issue in grid shelf view on tablet
- Deprecated warning in GitHub Actions
- Raise error when use PostgreSQL as database HOT 1
- Can not play song on Safari HOT 1
- Button text becomes invisible when hover on primary button
- Migrate images from DockerHub to GitHub Container Registry
- Push to multi-registries in GitHub Actions
- Can not login with [email protected] and foobar HOT 3
- Requirements for how audio library is stored HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from black_candy.