Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not let me play like host and like player #32

Open
johnfelipe opened this issue Jun 9, 2021 · 1 comment
Open

not let me play like host and like player #32

johnfelipe opened this issue Jun 9, 2021 · 1 comment

Comments

@johnfelipe
Copy link

i do this steps:

apt update
apt upgrade
shutdown -r now


sudo apt install curl
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

sudo apt-get update
sudo apt-get install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs yarn

cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL

rbenv install 3.0.1
delay in this part
rbenv global 3.0.1
ruby -v

ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]

gem install rails -v 6.1.3.2

Done installing documentation for rack, concurrent-ruby, sprockets, zeitwerk, tzinfo, i18n, activesupport, nokogiri, crass, loofah, rails-html-sanitizer, rails-dom-testing, rack-test, erubi, builder, actionview, actionpack, sprockets-rails, thor, method_source, railties, mini_mime, marcel, activemodel, activerecord, globalid, activejob, activestorage, actiontext, mail, actionmailer, actionmailbox, websocket-extensions, websocket-driver, nio4r, actioncable, rails after 37 seconds
37 gems installed


If you're using rbenv, you'll need to run the following command to make the rails executable available:

rbenv rehash

Now that you've installed Rails, you can run the rails -v command to make sure you have everything installed correctly:

rails -v

Rails 6.1.3.2

sudo apt install postgresql postgresql-contrib libpq-dev -y

systemctl start postgresql
systemctl enable postgresql

git clone https://github.com/ChrisLaneAU/kahootz_client.git
git clone https://github.com/jamaspy/kahootz_server.git

cd kahootz_server

Downgrade 3 for 2.6
rbenv install 2.6.2
delay in this part
rbenv global 2.6.2

ruby -v

ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]

bundle update --conservative mimemagic

bundle install

to setup required gems
Bundle complete! 22 Gemfile dependencies, 88 gems now installed.
Use bundle info [gemname] to see where a bundled gem is installed.

sudo -u postgres -i

for enter and active root user
sudo -u postgres createuser root -s

rails db:create

to create your local database (Postgresql is required)
Created database 'kahootz_server_development'
Created database 'kahootz_server_test'

rails db:migrate
rails db:seed

to generate the quizzes in your local database (This could take a while)
delay here 30 min about questions and answers entered

rails s
rails server -b 0.0.0.0

to start the server on localhost:3000
=> Booting Puma
=> Rails 5.2.3 application starting in development
=> Run rails server -h for more startup options
Puma starting in single mode...

  • Version 3.12.1 (ruby 2.6.2-p47), codename: Llamas in Pajamas
  • Min threads: 5, max threads: 5
  • Environment: development
  • Listening on tcp://localhost:3000
    Use Ctrl-C to stop

Starting the UI

cd
cd kahootz_client
npm install

to initialise the app

npm audit fix

added 167 packages from 104 contributors, removed 85 packages, updated 74 packages and moved 6 packages in 47.074s

15 packages are looking for funding
run npm fund for details

fixed 61746 of 62264 vulnerabilities in 1806 scanned packages
88 vulnerabilities required manual review and could not be updated
3 package updates for 430 vulnerabilities involved breaking changes
(use npm audit fix --force to install breaking changes; or refer to npm audit for steps to fix these manually)

npm start

pls view this video for my issues:
https://drive.google.com/file/d/1dBz9TZKIxpkDvRH3BTu0G-W9RvoGZEbo/view?usp=drivesdk

error in video are this

×
TypeError: Cannot read property 'players' of null
(anonymous function)
src/components/WaitingRoom/WaitingRoom.js:38
  35 | const setGameListener = gamePin => {
  36 |   gamesRef.child(`${gamePin}`).on("value", snapshot => {
  37 |     this.setState({
> 38 |       players: snapshot.val().players,
     | ^  39 |       gameStart: snapshot.val().gameStart
  40 |     });
  41 |   });


TypeError: Cannot read property '0' of undefined
PlayGame
src/components/PlayGame/PlayGame.js:150
  147 | if (count > 0 && !answered ) {
  148 |   return (
  149 |     <div className="display_game">
> 150 |       <Question question={questionList[questionCount - 1].content} />
      | ^  151 |       <Timer
  152 |         skip_question={skipQuestion}
  153 |         state={props.location.state}

how can solve all this?

@johnfelipe
Copy link
Author

anyone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant