Freibuis

Joined

80 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in How I setup sqlite3 on Ruby on windows

If you are using Windows use chocolatey to install your sqlite package and dev libraries

choco install sqlite

personally do your ruby/rails work under WSL2 if you want a fun time under windows. since WSL2 now supports systemd you will be able to do 100% the same as you would as a full ubuntu instance

use this guide to get WSL2 running
https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overview

I have a lot of experience running rails on windows...

since windows subsystem for Linux has been out most windows rails devs have moved to wsl as its a better platform form for rails development with the benefit of not having to work out the windows`isms trying to get ruby to work and compile gems correctly

I personally haven't done any rails development on windows for about 3 years since WSL is out.
now that WSL2 supports systemd you will be able to run services pretty close to a native linux experience.

Follow this guide to get WSL2 up and running

https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overview

once you are up and running you will need to get ruby, postgres, and other libraries

# install gpg keys
gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
# install rvm
curl -sSL https://get.rvm.io | bash
# install ruby 3.2.1
# rvm will handle most of the ubuntu packages for you
rvm install 3.2.1

# install the postgres dev library so rails gem install will work
sudo apt install  libpq-dev -y

# install the rails gem (latest version)
gem install rails
  • optional stuff # redis
sudo apt install redis-server

start postgres and redis via an alias

add the following to your ~/.bashrc file

alias dev-start='sudo systemctl start postgresql && sudo systemctl start redis-server'

I personally do not have postgres or redis-server running as start on boot because its a waste of laptop battery until I need it
when you want to run just run dev-start to have both services to run.

now back to postgres. Since this is on WSL you will have access to postgres unix socket. but your local wsl user will probably not have access to it.
you will have 2 options to fix this up.

  • add your local wsl user as a postgres user and give it super user access to postgres
  • lower permission of postgres to allow unix socket access for your user with out any password

if you want to use postgres unix socket you have to remove the :host from the database.yml file . removing the :host tells the pg gem to use the unix socket instead

Pretty much as the title says.. I am looking for a javascript library that can authenticate against Doorkeeper.
We currently have a really old in-house authentication process and migrating to build a brand new federation Idp system that is built around devise/doorkeeper.

all our front ends spa's need to migrate to use doorkeeper/openid using PKCE. the issue is
we have tried the following libraries to limited success
@azure/msal-browser can't use this because the authority URL has to be https so cant be used in development without hassle.
@auth0/auth0-spa-js works against auth0 but its a pain to get it to work against doorkeeper as they uses no standard oauth standard routes creating custom routes in rails alsmost works.

any one know of any great libraries that you use that work really well against doorkeeper using PKCE auth code flow?

I used to use this method object_class: OpenStruct but when you use this pattern you cant

  • transform inside the document it has pointers/links to break out into another object type
  • Chain different secondary api calls for any links/pointers

also

  • OpenStruct has terrible performance and rubocop will complain about this.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2023 GoRails, LLC. All rights reserved.