I use Ruby on both Mac and on Windows 11 (currently build 22631.3737 as of 6.24.2024).
I performed the following to uprade my local Windows Ruby installation (from 3.1.2p20 and Rails 7.0.3.1) to the versions specified above:
-
Note: I install some development tools on my local drive
C:but do most work on another drive. Make sure to hunt down the correct drive andC:\Usersdirectory! -
I performed a clean install of
Ruby 3.3.3.1using the recommended Windows installer (which differs quite a bit frombrewbased installations). (Thankfully, the Ruby Installer has allmakedependencies rolled into it vastly simplifying its setup!) -
Make sure to wipe the directories
C:\msys64by manually removing the directory (if it lingers) using the Settings > Apps > Installed apps Uninstaller. (If it still persists use a force delete like CCleaner and carefully purge the Windows Registery using the Registery Cleaner!) -
That'll allow you to cleanly install
MSYS2again (I ran into issues after installingrubywithrails). I used settings1,2,3and all succeeded after wiping any lingering dependencies per the above. -
ruby --versionthengem updatelastlygem install rails. Those should all succeed as expected. -
I noticed that Rails doesn't populate the correct
bindirand will complain. It'll say something like:/c/Users/adami/AppData/Local/Microsoft/WindowsApps/rails: line 6:. Surprisingly, this occurred after updating my System > Environment VariablePath- The
railsfile was found here:C:\Users\<MY_USER>\AppData\Local\Microsoft\WindowsApps - The
rubyinstall was here:C:\Ruby33-x64
- The
-
I fixed this using the absolute drive path (per the above) on line
6:=begin bindir="/C/Ruby33-x64/bin" exec "$bindir/ruby" "-x" "$0" "$@" =endThat way
railscan be called and executed on driveG: -
I was then able to confirm
rails --version:$ rails --version Rails 7.1.3.4
and initialize the contents of /rails//web with the correctly updated version:
rails new web # from within the /rails directory within this repo
docker-compose up
# If using: Docker Compose Engine V2
docker compose up - May need to also perform the above with
bundlelocally on Windows 11. - The default database in
postgres. - http://localhost:3000/ will display the Rails default app page.
- Run
rails new projectafter an initial commit has been created in the parent directory - it'll cause commit issues otherwise sincerailsinitializes a.githistory.