Contributees / First-Ruby-Quest

Web app referencing ruby related open source issues suitable for a first contribution and/or junior developers (or any developpers!)
MIT License
1 stars 2 forks source link

Override Tailwind styles #41

Open Oli0li opened 7 months ago

Oli0li commented 7 months ago

I started overriding Tailwind styles in these PRs to fix the appearance of lists, blockquotes and code blocks:

https://github.com/Contributees/First-Ruby-Quest/pull/37 https://github.com/Contributees/First-Ruby-Quest/pull/38

We probably need to do the same for the check box on the log in screen and the field to enter a url when creating an issue, as Claire pointed out in PR https://github.com/Contributees/First-Ruby-Quest/pull/38.

Checkbox next to "Remember me" is black on black background: Screenshot 2024-02-19 225948

White text on white background: Screenshot 2024-02-19 230029 Screenshot 2024-02-19 230051

Apurv428 commented 7 months ago

Hi @Oli0li , can you please help me with the setup? How should we setup this repository locally?

Oli0li commented 7 months ago

Hi @Oli0li , can you please help me with the setup? How should we setup this repository locally?

Hello @Apurv428! @ClaireDMT just added some explanations for setting up the project here: https://github.com/Contributees/First-Ruby-Quest/blob/main/CONTRIBUTING.md

Could you please let us know if that works for you? Let us know if anything is unclear/not working as planned. And thank you for your help!

Apurv428 commented 7 months ago

I encountered an error with the command not being found during the 5th step. (Error: command not found). As a workaround, I used the rails server command, which successfully initiated the server on localhost:3000. But I am getting the following page:

image

Oli0li commented 7 months ago

I encountered an error with the command not being found during the 5th step. (Error: command not found). As a workaround, I used the rails server command, which successfully initiated the server on localhost:3000. But I am getting the following page:

Sorry to hear that @Apurv428 😥 Does it work if you run bin/dev or bin/front_dev instead? Normally we cannot use "rails s" with Tailwind

Edited: I had mistakenly typed "bin/front_end" instead of "bin/front_dev"

Apurv428 commented 7 months ago

This is also not working.

Oli0li commented 7 months ago

Sorry about that @Apurv428. May I just check if all these previous steps worked without any error?

  1. Forking this repository to create your own First-Ruby-Quest repository on your GitHub account
  2. Clone that new repository from your GitHub account onto your machine
  3. Going into the repository in your terminal with "cd frst-ruby-quest"
  4. Installing all necessary gems by running "bundle install" in your terminal
  5. Running "rails db:setup" in the terminal

With all of these done, when you open the project with your editor (with "code ." in the terminal if you are using VS Code), you should be able to see a file called bin/dev and be able to run it by running bin/dev in your terminal. If you don't see it, could you please post a screenshot or video of what you see?

Apurv428 commented 7 months ago

image

Oli0li commented 7 months ago

Thank you @Apurv428. I can see you do have a "bin/dev" file, but you don't have the "bin/front_dev" file that should be right under it as you can see here, and your config/database.yml is also longer with 103 lines than the 85 lines it should be (see file here). Looking at the minimap, it looks like some changes may have been made to this file.

Since you don't have the "bin/front_dev" file, which was added 5 days ago, it looks like you may have an old version of the project. Could you sync your fork, do "git pull" in your terminal and try again to run bin/dev, please? If that doesn't work, could you please show me the error message?

Apurv428 commented 7 months ago

I did the git pull. On running bin/dev, the file(dev) is opening.

Oli0li commented 7 months ago

Thank you @Apurv428. Are you using Windows for the terminal, by any chance? bin/dev would just open the file in that case. We have been using Ubuntu, which only requires to type bin/dev or dev.

The Ruby on Rails documentation says:

If you are using Windows, you have to pass the scripts under the bin folder directly to the Ruby interpreter e.g. ruby bin\rails server.

Source: https://guides.rubyonrails.org/getting_started.html#starting-up-the-web-server

So could you try the following and let me know if that works for you, please?

ruby bin\dev
Apurv428 commented 7 months ago

Yes, I am using windows terminal. I tried ruby bin\dev and ruby bin\front_dev Got the error: C:\Ruby32-x64\bin\ruby.exe: no Ruby script found in input (LoadError) But when I tried the command mentioned in the link given by you: ruby bin\rails server It worked and opened the localhost but got the error for tailwind

Oli0li commented 7 months ago

OK, thank you @Apurv428. It is normal that you see an error when running ruby bin\rails server because Tailwind cannot be used with rails server. This is why when installing Tailwind, a bin/dev file is generated and you must use bin/dev to be able to see the app properly. I looked up the error you got when running ruby bin\dev, and it seems this is because we have this line in the bin/dev file:

#!/usr/bin/env sh

That means this is a bash file and cannot be run with ruby bin\file_name or by just entering bin/dev in a Windows terminal. In Windows PowerShell, can you please try typing this and let me know if that works?

sh bin/dev

Source: https://stackoverflow.com/questions/1098786/run-bash-script-from-windows-powershell

Sorry about this and thank you for your patience!

Apurv428 commented 7 months ago

The command was executed successfully, but an error occurred afterward. Despite searching on Stack Overflow, I couldn't find a solution to address this specific issue.

C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/process.rb:54:in spawn': Exec format error - bin/rails tailwindcss:watch (Errno::ENOEXEC) from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/process.rb:54:inblock in run' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/process.rb:53:in chdir' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/process.rb:53:inrun' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/engine.rb:367:in block (2 levels) in spawn_processes' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/engine.rb:364:inupto' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/engine.rb:364:in block in spawn_processes' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/engine.rb:363:ineach' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/engine.rb:363:in spawn_processes' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/engine.rb:57:instart' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/cli.rb:42:in start' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor/command.rb:27:inrun' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor/invocation.rb:126:in invoke_command' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor.rb:369:indispatch' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor/base.rb:444:in start' from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/bin/foreman:7:in<top (required)>' from C:/Ruby32-x64/bin/foreman:32:in load' from C:/Ruby32-x64/bin/foreman:32:in

'

Apurv428 commented 7 months ago

I believe the issue lies with Windows. I've seen similar problems on GitHub issues being raised, and despite attempting the suggested commands, the issue persists.

Oli0li commented 7 months ago

I believe the issue lies with Windows. I've seen similar problems on GitHub issues being raised, and despite attempting the suggested commands, the issue persists.

Yes from what I could gather, that seems to be a known, unresolved issue... I did see someone say they solved it by removing bin/ in Procfile.dev. Have you tried this solution? I tried it with my Linux terminal and it doesn't break anything from my side so we could consider changing it if that helps.

When I started learning Ruby, I was told to use Linux instead of Windows for the terminal, but I didn't know why. But seeing all the issues you have been running into and the lack of solutions I find online except for "just use Linux", I wonder if it might be easier in the end to just install a Linux distribution on your terminal. I can confirm that I never had issues running commands with Ubuntu, you can find instructions on how to install it here, if you'd like to give it a try: https://canonical-ubuntu-wsl.readthedocs-hosted.com/en/latest/guides/install-ubuntu-wsl2/