Skip to content

Instantly share code, notes, and snippets.

@andyyou
Last active January 9, 2019 02:58
Show Gist options
  • Save andyyou/1efe82615eaddce1ea0a7415ce70cd8c to your computer and use it in GitHub Desktop.
Save andyyou/1efe82615eaddce1ea0a7415ce70cd8c to your computer and use it in GitHub Desktop.
windows 10 大尺度私房菜

windows 10 大尺度私房菜

  • Configure & Install subsystem for linux
# https://docs.microsoft.com/en-us/windows/wsl/install-win10
$ Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
$ choco install firacode
$ choco install git
{
  "editor.fontLigatures": true,
  "editor.tabSize": 2,
  "editor.fontSize": 14,
  "editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace"
}
@andyyou
Copy link
Author

andyyou commented Jun 27, 2018

@pjchender
Copy link

pjchender commented Nov 22, 2018

Install Ruby on Rails

Install Ruby directly on RubyInstaller.

Install SQLite and Integrate with Ruby on Rails

ridk exec pacman -S mingw-w64-x86_64-sqlite3
gem install sqlite3 --platform ruby

Error Handling: cannot load such file -- sqlite3/sqlite3_native

  1. Move into the path of sqlite3 gem
cd C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32
  1. Run the code below
ridk enable
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb  install
  1. Test if it run correctly
irb
require "sqlite3"    # true

Install PostgreSQL and integrate with Ruby on Rails

Install PSQL from official website directly.

  1. Set all METHOD in pg_hba.conf as trust on both IPv4 and IPv6, the file path of pg_hba.conf is %HOMEPATH%\psql\pg_hba.conf in Windows.

  2. Open the app pgAdmin in program files, create an new role. Check image here if needed.

  3. The name of the role SHOULD BE SAME AS the system user, leave the password field empty and make the privilege as SUPERUSER.
    Check image here.

The pg_hba.conf should look like the settings below:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
host    replication     all             127.0.0.1/32            md5
host    replication     all             ::1/128                 md5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment