danielschuster-muc/potter-db

[Bug]: Error setting up this project on Windows 11

Closed this issue · 2 comments

Project

API

Bug description

I'm new to Ruby development, I've just installed Ruby and Ruby-on-Rails today. Unfortunatelly, I'm having troubles setting up the project. This is a blocker for me, I can't contribute to your project. Though I can try looking at the front-end part.

I'm following the instructions in the backend/README.md file.

rails db:create db:migrate

and this step fails with the following error:

image

what have I tried to fix it myself?

  1. this
     gem install tzinfo-data
  2. also, this https://stackoverflow.com/a/23816959/1429387
  3. I've tried to run the command within MINGW64 git bash and in windows cmd prompt with Ruby

Expected Behavior

No response

Steps to reproduce

all steps are described in the backend/README.md file

Screenshots

image

Logs

$ rails db:create db:migrate
rails aborted!
TZInfo::DataSourceNotFound: tzinfo-data is not present. Please add gem 'tzinfo-data' to your Gemfile and run bundle install
D:/dev/hacktoberfest/potter-db/backend/config/environment.rb:5:in `<main>'

Caused by:
TZInfo::DataSources::ZoneinfoDirectoryNotFound: None of the paths included in TZInfo::DataSources::ZoneinfoDataSource.search_path are valid zoneinfo directories.
D:/dev/hacktoberfest/potter-db/backend/config/environment.rb:5:in `<main>'
Tasks: TOP => db:create => db:load_config => environment
(See full trace by running task with --trace)

Well, I think that the problem is resolved by removing the platforms option altogether.

Apparently, there is a bug in Bundler that means there's currently no platform option that will match 64-bit Ruby 3.1 on Windows. The solution here is to remove the platforms option.

After doing this, run bundle update at the command line to install the tzinfo-data gem and you'll then be able to start your Rails server or console.

Thank you very much for submitting this issue.

As the bug doesn't seem to be resolved by Bundler atm, your solution is probably the best.
Just make sure to not commit the Gemfile when creating a PR with changes in the backend.