Elijah

Joined

180 Experience
1 Lesson Completed
0 Questions Solved

Activity

Posted in Setup Windows 10 Discussion

Add host: 127.0.0.1 in config/database.yml to default: &default as you're using TCP, not a Unix socket.

Posted in Setup Windows 10 Discussion

Glad to know you got it working! I know you asked about how to secure your password in database.yml. Passwords must be provided as-is in that file, but you could use environment variables. You can define your password in .env as export POSTGRES_UPASSWORD='password' and then refer to it with <%= ENV['POSTGRES_UPASSWORD'] %>. The problem with this approach is that you're just passing off your password to .env and really it only works if you're working with other people. Malicious code could still steal your environment variables. If you're willing to set up a server, you could set up another server for PostgreSQL and secure it, only allowing your IP address to connect. That way, even if they had the password, it's no good. Of course, then you need to keep your SSH keys secure.

The truth is that there's no good way to protect against an attack other than practicing good security on your machine.

Posted in Setup Windows 10 Discussion

You're welcome!

Posted in Setup Windows 10 Discussion

The reason why is because in VS Code it by default uses either PWSH/Command Prompt for commands (I don't know, but for me it's PWSH). You need to change it to WSL by clicking the plus icon to the right of the tabs in the terminal window and add "WSL". If it doesn't appear, you may need to get the Remote Development extension and use it that way. Your Rails installation is managed through WSL so adding it as an environment variable wouldn't work.

Posted in Setup Windows 10 Discussion

I assume you're using WSL, which can cause a bug where files can be owned by root instead of your user. Try restarting your computer and see if WSL fixes itself, or check who actually owns the folder with ls -al. sudo chown -R your_wsl_user myapp should work.

Finally, check if the attributes of myapp aren't immutable. Change them if they are (chattr -R -ia myapp).

Posted in Setup Windows 10 Discussion

Your issues probably stem from the fact you don't have those dependencies. What's your Ubuntu version? Have you tried sudo apt update and sudo apt install libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev
libcurl4-openssl-dev software-properties-common libffi-dev
?

Posted in Setup Windows 10 Discussion

Your rakefile should be getting application.rb, not application. Make sure your rakefile is actually trying to get application.rb and not application.

Posted in Setup Windows 10 Discussion

For anyone having problems with WSL and Postgres when running rake db:create, try adding host: 127.0.0.1 in config/database.yml to default: &default as you're using TCP, not a Unix socket.