1. How to solve:Alias parsing was not enabled. To enable it pass aliases:true to to Psych::load or Psych::safe_load. (Psych::AliasesNotEnabled)
Add gem 'psych', '< 4'
to your Gemfile and perform bundle install
2. Rails runs fine and webpacker runs fine but getting blank screen on localhost:3000
Check if there is a version mismatch between shakapacker in ruby and js. If so match their versions to 6.6.0
3. Rails runs fine and webpacker runs fine but getting blank screen on localhost:3000 despite having matching versions of shakapacker
Have you setup the app by running
./bin/setup
?Have you started webpacker by running
./bin/webpacker-dev-server
?Since you're running Rails from a subsystem, you will have to run it in 0.0.0.0 to expose it through the network. Start the rails server with this command:
RAILS_ENV=development bundle exec rails server -b 0.0.0.0
Are there any errors shown when running Webpacker or Rails? If so try debugging them
4. Engine node is incompatibe with this module. Expected version "18.12". Got "xx.xx.xx"
Execute the following in a new terminal
nvm install 18.12
nvm use default 18.12
nvm alias default 18.12
Confirm version by executing
node -v.
If it is still showing the previous version refresh the terminal (close and reopen). If still persists uninstall current version of node usingnvm uninstall xx.xx.xx
5. FATAL: Role "name" does not exist
https://stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-exist
CREATE ROLE <name> WITH SUPERADMIN
If issue still persists
sudo -u postgres createuser <your username>
6. Errors related to :6379 port
Install/ Reinstall redis
https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/install-redis-on-windows/
https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/install-redis-on-mac-os/
7. Dev server has been initialised using an options object that does not match the API schema. options has an unknown property '_assetEmittingPreviousFiles' ....
-
Downgrade @webpack-cli/serve
"resolutions": { "@webpack-cli/serve": "1.5.1" }
8. Issues with line endings in Windows
Many people might face the issues of type unterminated string meets end of file
This is because of the issues with how Unix and Windows handles line endings. Windows uses CRLF for line endings. Unix uses LF for line endings. For the same reason when git is installed in Windows, it tends to auto format all line endings. This means if we have already configured line endings to be CRLF(\r\n
) windows will change replace all the \n
s with \r\n
effectively rendering it to be \r\r\n
which throws errors. To handle this, install WSL in windows and:
Install dos2unix:
sudo apt install dos2unix
Execute command:
find -type f -print0 | xargs -0 dos2unix
This reverses the above process and turns back all the line endings to proper CRLF.
Note: This is a time consuming process. Please be patient.
After this turn off auto formatting line endings in git to prevent future errors:
git config --global core.autocrlf false
git config --global core.eol crlf
9. Cannot install gem pg
Check if Postgresql has been installed
Execute
sudo apt install postgresql-contrib libpq-dev
10. No such file or directory as ruby\r (Again issue with line endings
Delete the current repository.
Open a WSL terminal
Go to the desired location where you want to clone the repository within this terminal window (Using cd and mkdir if required)
Clone the repository using instructions in the book
Open VSCode in the WSL terminal using
code <repo_name>
Execute
./bin/setup
again