publiclab / plots2

a collaborative knowledge-exchange platform in Rails; we welcome first-time contributors! :balloon:
https://publiclab.org
GNU General Public License v3.0
958 stars 1.83k forks source link

Work Together To Install plots2 on your Local Machine(Setup) #10844

Open TildaDares opened 2 years ago

TildaDares commented 2 years ago

Hi everyone, welcome to Public Lab🎈. This issue is meant to help you resolve any errors you might be getting while installing plots2 on your local machine or document the steps you took to resolve the error.

πŸ’» πŸŽ₯ Installation video: watch this excellent video of the GitPod install process running, by @AndroGenius-codes: https://github.com/publiclab/plots2/issues/11467

If you were able to resolve an issue someone else was facing, you can outline the steps you took to resolve the error. Also, if you were able to solve the error, report back with the steps you took to solve the error.

You can also take a look at our previous setup issue to look for solutions to errors you might be facing. Thank you for contributing to Public Lab.


Also a heads up: if you are installing the plots2 project on your local, maybe consider using sqlite3 for database . On step 7 choose the second option,

If sqlite3, run cp config/database.yml.sqlite.example config/database.yml to make a copy of config/database.yml.sqlite.example in config/database.yml. kindly note if you choose to use sqlite some tests may fail. The project was setup initially to use mysql and some tests are tailored for mysql db. No need for alarm, we are working to fix these and this will not interfere with your development process

As we are having issues reported by folks using mysql2 (read more)

Originally posted by @cesswairimu in https://github.com/publiclab/plots2/issues/10840#issuecomment-1079627068

TildaDares commented 2 years ago

Leave a comment here with the details of the errors you're facing. Thank you!

akanbifatimah commented 2 years ago

HI @TildaDares , I have been able to run infragram on my local machine , do I need to install plot2 in order to work on this project

TildaDares commented 2 years ago

Hi @akanbifatimah, no you don't have to install plots2.

akanbifatimah commented 2 years ago

alright,Thank you

ishikajn8126 commented 2 years ago

Hello everyone!! Myself Ishika Jain, an outreachy aspirant.. I'm facing some issue in installing plots2 on my local machine. I'm stuck at step 5 of standard installation. I have attached ss of the errors that I'm getting. Would really appreciate any help in solving this issue...

Screenshot from 2022-03-28 19-25-31

Screenshot from 2022-03-28 19-25-11

TildaDares commented 2 years ago

Hi @ishikajn8126, have you installed rbenv or rvm? https://github.com/publiclab/plots2/blob/main/doc/PREREQUISITES.md#ruby

untari commented 2 years ago

Hi @TildaDares I'm participating on outreachy, do we have to contribute to the project that listed for the outreachy, or we can contribute to other repo too? Thanks!

cesswairimu commented 2 years ago

Hi @untari, you can contribute to other repos too. thanks

untari commented 2 years ago

Hi @cesswairimu, noted with thanks!

stephaniequintana commented 2 years ago

@ishikajn8126, it appears we may have run into the same issue. My Mac would not download rvm or rbenv due to an SSL certificate problem. In addition to the errors you mentioned, I received the following when I tried to run curl -L https://get.rvm.io | bash -s stable.

Screen Shot 2022-03-22 at 4 30 10 PM

If you're experiencing the same, please reach out to me. I found a quick and easy way to bypass this.

Also, please be advised that many in the community work exclusively with/through gitpod, it's a great alternative to setting up your local environment and you'll be immediately up and running.

ishikajn8126 commented 2 years ago

Hi @ishikajn8126, have you installed rbenv or rvm? https://github.com/publiclab/plots2/blob/main/doc/PREREQUISITES.md#ruby

Hey @TildaDares, yeah i seem to have skipped the prerequisities... Got that issue resolved now!

ishikajn8126 commented 2 years ago

@ishikajn8126, it appears we may have run into the same issue. My Mac would not download rvm or rbenv due to an SSL certificate problem. In addition to the errors you mentioned, I received the following when I tried to run curl -L https://get.rvm.io | bash -s stable.

Screen Shot 2022-03-22 at 4 30 10 PM

If you're experiencing the same, please reach out to me. I found a quick and easy way to bypass this.

Also, please be advised that many in the community work exclusively with/through gitpod, it's a great alternative to setting up your local environment and you'll be immediately up and running.

Hey @stephaniequintana! Thanks a lot for offering support!! I got that issue resolved!

Forchapeatl commented 2 years ago

@TildaDares I was able to resolve this issue 4396 . The error occurs when step 6 of the installation guide is skipped.

PeculiarE commented 2 years ago

If you're experiencing the same, please reach out to me. I found a quick and easy way to bypass this.

Also, please be advised that many in the community work exclusively with/through gitpod, it's a great alternative to setting up your local environment and you'll be immediately up and running.

Hello @stephaniequintana. So I did try starting the app on gitpod. But got this error:

Screenshot 2022-03-29 at 23 38 25

Have you been able to succesfully run the app on gitpod?

stephaniequintana commented 2 years ago

@PeculiarE, the original error I was referring to, above, is the one pertaining to the SSL Certificate problem. I solved that on (on my Mac) by bypassing the curl security and I was then, finally, able to download rvm. I was still unable to setup my local environment, view the thread starting here: https://github.com/publiclab/plots2/issues/4936#issuecomment-1075936910.

To your specific question, I did finally get GitPod to run successfully. I cannot advise you on what to do, but I will tell you what I did. ~Firstly, per the above thread, I incorrectly ran passenger start in GitPod. This is not necessary as it is already configured in plots2/.gitpod.yml to do so.~ <- I actually did do this in my local environment, per the thread... The next time I opened the repo in GitPod, there were a multitude of differences between my forked branch and the origin (mostly due to everything under the sun I was downloading to get zsh to cooperate with rvm). Rather than ignoring those, or squashing specific commits or rebasing to an earlier commit, or ...(there were many ways I could have remedied my branch)... I deleted the repo and started with a freshly forked one. After that, pending the VERY long build, the error page was no longer there and the app now runs smoothly.

I'm sorry I cannot provide more specific direction. Although, I do highly recommend asking the group. I'm a bit blown away by the knowledge and willingness to help that everyone here seems to have ❀️

ishikajn8126 commented 2 years ago

Hey everyone! I got stuck with another error at step 5 of standard installation, which occurred on running the command bundle install : Would really appreciate any help in this regard..!

Screenshot from 2022-03-30 11-49-12

Screenshot from 2022-03-30 11-49-25

Screenshot from 2022-03-30 11-49-45

TildaDares commented 2 years ago

Hi @ishikajn8126, do you have nodejs installed? You can install it by running sudo apt-get install nodejs

PeculiarE commented 2 years ago

Thank you, @stephaniequintana. So, I wasn't running GitPod on my fork but directly from the main repo. Even tried setting it up on my local machine but kept on encountering one error or the other. Eventually, I followed your advice: deleted my existing fork, re-forked, and then tried running it again on GitPod. Had to change the db configuration in the database.yml file to an sqlite3 db before it eventually worked πŸŽ‰. Thank you so much!

P.S. Did you have to tweak your database.yml file as well? Or it worked for you right out of the bag?

PeculiarE commented 2 years ago

@ishikajn8126 When I tried setting up the project on my machine too, I faced this error even though I had nodejs already installed. But luckily for me, the error message also told me the command to run to fix it. The command was quite long and I can't remember it exactly. And sadly, recent console messages in my terminal have overwritten it. 😒 😞

I would suggest exactly what @stephaniequintana said. Try running the project on GitPod instead. It will save you time because even though I fixed this error you're facing now, I encountered like 6 more ahead and the app didn't still run perfectly after trying to fix all of them.

If you do have any issues running it on GitPod, please feel free to reach out to either me or Stephanie as it is working quite well for both of us πŸ˜„

illyShelly commented 2 years ago

Hello @TildaDares , I would like to point to one thing and differences which I found out during installation and reading files. The link you mentioned above for standard installation https://github.com/publiclab/plots2#standard-installation differs from the Readme file for plot2 repo link: [https://github.com/publiclab/plots2/blob/master/README.md]()

Especially,

I ran into error message related to webpack and manifest.json which I solved with this command: bundle exec rake webpacker:install

I could update it πŸ™‚

This was my error after running server:

Screenshot 2022-03-30 at 17 55 02
stephaniequintana commented 2 years ago

@PeculiarE, I'm so glad to learn you're up and running.

P.S. Did you have to tweak your database.yml file as well? Or it worked for you right out of the bag?

I actually tweaked the file (commented out the sql directive) initially. Though I meant to, I never went back to see if it would worked without the directive commented out.

Honestly, I experienced so many issues trying to set up locally that once I realized I can work (and gain experience) with GitPod, I never looked back. When I find some time, I will try again (bc I LOVE my VScode setup), but the errors I encountered and the (embarrassingly) amount of time I wasted coupled with the time constraints were outweighed by my excitement to get started. @ishikajn8126, I hope you're finally set up, too. If not, @PeculiarE makes an excellent point towards the time you will save (and from our personal experience, the errors you are likely to encounter in the upcoming steps).

Cheers, all - I hope everyone is having a great day!

Forchapeatl commented 2 years ago

If you're experiencing the same, please reach out to me. I found a quick and easy way to bypass this. Also, please be advised that many in the community work exclusively with/through gitpod, it's a great alternative to setting up your local environment and you'll be immediately up and running.

Hello @stephaniequintana. So I did try starting the app on gitpod. But got this error:

Screenshot 2022-03-29 at 23 38 25

Have you been able to succesfully run the app on gitpod?

@PeculiarE here is the solution https://github.com/publiclab/plots2/issues/4396#issuecomment-1079781786

TildaDares commented 2 years ago

for standard installation https://github.com/publiclab/plots2#standard-installation differs from the Readme file for plot2 repo link: https://github.com/publiclab/plots2/blob/master/README.md

Hi @illyShelly, thank you for the observation! We no longer make use of the master branch so it's the README on the main branch you should use https://github.com/publiclab/plots2/blob/main/README.md

illyShelly commented 2 years ago

@TildaDares got it πŸ˜„ I have no idea how I get there. Thank you.

PeculiarE commented 2 years ago

Thanks @stephaniequintana for your response. Lol...I know how that feels, wasting a lot of time trying to debug locally. But yeah, we're lucky we have GitPod to save the day πŸ˜…

@Forchapeatl .....thank you for your help. However, I did check out that thread while debugging on my local and implemented your suggestion but it didn't resolve my issue 😒. Plus, the error-message screenshot I shared was gotten when I was trying to run the app on GitPod and not on my local machine. I fixed it by simply starting the whole forking process afresh, tweaked the database.yml file on GitPod and seeded the database. And everything was well.

ishikajn8126 commented 2 years ago

Hi @ishikajn8126, do you have nodejs installed? You can install it by running sudo apt-get install nodejs

Hey @TildaDares, I tried installing nodejs and running bundle install again, it's still giving the same error. I've got the project on running on gitod though..!

Hey @PeculiarE @stephaniequintana, thanks a lot for your inputs, I've got the project running on gitpod and opened a PR as well..

PeculiarE commented 2 years ago

Awesome news @ishikajn8126 and you're very welcome πŸ˜„

simransia commented 2 years ago

Hello @PeculiarE @stephaniequintana

I was trying to run the application using gitpod. But I am getting this error shown in the image below gitpod : Could you please tell me what I am doing wrong?

stephaniequintana commented 2 years ago

@simransia, just brainstorming here...has it finished loading? When I use GitPod it tends to take quite a while for all the dependencies to load and then for the app to run. I see this error screen until the loading is complete...

simransia commented 2 years ago

@stephaniequintana yes mam it also took a while for loading all the dependencies in my browser as well. After the loading was completed I was not able to see the live preview of the application. So in the terminal I run the command "passenger start" and then this error page appears.

stephaniequintana commented 2 years ago

@simransia, I believe there might be an issue out of our control. I just tried to open it in GitPod and have received the same error page that you posted above, though I was working through GitPod just a few hours ago with no issues.

Two things:

1)If you are working on an FTO issue, you should still be able to complete the work on your branch. This issue appears to be with the app/views/layouts/application.html.erb file so unless you are woking directly with that file, you can still work.

2)For future reference, wiith GitPod, the passenger start command is already configured to run (in the gitpod.yml file) so you will not need to input it. I assume you were doing so as a troubleshooting technique, but I wanted to make sure that you are aware.

I'm sorry that I can't offer a better solution at this point. Someone with a more specific skillset will need to take a look into this. @jywarren will know best who that might be.

stephaniequintana commented 2 years ago

@simransia, I've successfully opened plots2 in GitPod. At your convenience, please try it again - do ensure you are opening it from the fork in your repository. FYI, it took almost 8 minutes for the browser window to open, so please don't get discouraged, grab yourself a drink and be patient, it should be up and running soon!

simransia commented 2 years ago

Congratulations to you for opening it successfully !! But I am still unable to see the live preview of the page even after waiting for 30 minutes. πŸ˜… And yes I am opening it from the forked repository.

This is how my gitpod workspace looks like right now.

I hope I will find it's solution soon.

stephaniequintana commented 2 years ago

@simransia, I'm not sure what the problem could be. After I was unable to get my local environment setup, I had to re-fork the project in order to successfully open it on GitPod. I know that @PeculiarE has also solved the issue she had with GitPod, I believe she also re-forked the repo (& she may have had to commented out one of the database directives). Hopefully she will be able to tell us more specifically what she did and that will work for you as well.

At this point, please post in the Gitter chat in case someone there has experienced/solved the same. I understand that the browser in GitPod is not opening/updating. I do hope that you are still able to access and edit the files in the app. I'm sorry I couldn't help you more, I hope it's successfully running soon.

simransia commented 2 years ago

Thankyou @stephaniequintana for your efforts which you have put in trying to solve my issue. @PeculiarE could you please tell me what changes you have made in the database directive ? Because that might solve my problem as well.

stephaniequintana commented 2 years ago

@simransia, you're most welcome. I wish I could have done more.

I see that you've reached out on Gitter, I was hoping someone there might have been able to help. Of course, I don't know what all you have tried, but per the comments above both @PeculiarE and I were able to delete our forks and then a re-fork finally opened...I would otherwise ensure that you have pulled all of the latest changes from the origin. It just doesn't make sense that it is working for others.

Per the thread here, it is in the Gemfile where we toyed with commenting out the sql directive:

group :mysql, :production, :development, :test do
  gem 'mysql2', '>= 0.4.4'
  # mysql 0.4.3+ causes a version mismatch, apparently, and demands 'activerecord-mysql2-adapter'
end

She and I merely discussed this, I'm uncertain whether she did or did not make this change or if it did or did not have any affect on GitPod.

Possible other things you might try:

Lastly, know that setting up plots2 is not a requirement for participating in the internship. I understand that it is highly desired, but it by no means disqualifies you.

I hope any of the above helps, @simransia!

akanbifatimah commented 2 years ago

@stephaniequintana Thank you so much for all your help so far, just like @simransia , I am also on windows OS and haven't been able to run plot2 either via gitPod or on my local machine. I reached out to @PeculiarE who successfully ran the project on gitpod after facing some issues while trying to run on her local machine (Mac Os), she mentioned doing some editing in her database.yml file which fixed the error she was getting and have since been able to run it successfully on git Pod. However I tried same but still haven't been able to run it successfully via git Pod. My other option is to try running it via my Local Machine. That has not been easy too, as installing rvm 2.7.3 still throws error.

So I generally think it's an error associated with running ruby on windows.

@kunmi02 has been very helpful, if we are able to run plot2 locally on a Windows OS, I will definitely post the solutions here.

So sorry @simransia , I totally understand how stressful this could be, hopefully, it should be resolved soon.

stephaniequintana commented 2 years ago

@simransia and @akanbifatimah, do also try googling the errors or your system info + gitpod connection errors...github is such a vast network, we may find the answer in the wild. πŸ€

kunmi02 commented 2 years ago

Thank you @akanbifatimah .

I and @akanbifatimah have been trying to set up plot2 locally. We were able to install rvm on windows, the issue now is setting up rvm with ruby 2.7.3. Whenever we run the rvm list we get this error ruby-2.7.3 [ missing bin/ruby ].

We will continue debugging and I believe we will have a solution soon.

stephaniequintana commented 2 years ago

@kunmi02 and @akanbifatimah, I assume you've tried everything under the sun...I had the same(ish) issue on my Mac and it was due to a certificate error. I won't make you hash it all out again, but I found this for you. It is along the lines of what cleared up my issue.

akanbifatimah commented 2 years ago

@kunmi02 and @akanbifatimah, I assume you've tried everything under the sun...I had the same(ish) issue on my Mac and it was due to a certificate error. I won't make you hash it all out again, but I found this for you. It is along the lines of what cleared up my issue.

Thank you so much @stephaniequintana

kunmi02 commented 2 years ago

@stephaniequintana I am running a mac system and I have no issues with installation. The installation we are working on now is on a windows system. Thanks for the solution shared. We will definitely try that out and share outcome

imranburki commented 2 years ago

Hi I am facing error while installing ruby. Screenshot from 2022-04-09 12-15-59

Forchapeatl commented 2 years ago

Hi I am facing error while installing ruby. Screenshot from 2022-04-09 12-15-59

@imranburki I faced this issue some time ago run Disable RVM from trying to install necessary software via apt-get rvm autolibs disable Then try installing Ruby: rvm install 2.7.3

reference https://stackoverflow.com/a/42286377

kunmi02 commented 2 years ago

@simransia I think i have a fix for your issue. I got the same error on gitpod too and I was able to fix it finally. I had the same error on gitpod too

Screenshot 2022-04-09 at 23 27 13

The first thing I did was to stop the passenger server by pressing ctrl + c. Then I did a yarn install. I did this because I though the issue would be from package.json file. Yarn install gave me this error $ yarn install yarn install v1.22.17 [1/4] Resolving packages... [2/4] Fetching packages... warning Pattern ["grow-textarea@https://github.com/jywarren/grow.git#d54141c9456343f14cc6c935faa0915af09eb669"] is trying to unpack in the same destination "/home/gitpod/.cache/yarn/v6/npm-grow-textarea-1.0.1-d54141c9456343f14cc6c935faa0915af09eb669/node_modules/grow-textarea" as pattern ["grow-textarea@git://github.com/jywarren/grow.git#d54141c9456343f14cc6c935faa0915af09eb669"]. This could result in non-deterministic behavior, skipping. warning Pattern ["woofmark@https://github.com/jywarren/woofmark.git#plots2"] is trying to unpack in the same destination "/home/gitpod/.cache/yarn/v6/npm-woofmark-4.0.3-78821fad8687757a4201fbef3be4b85418e785ef/node_modules/woofmark" as pattern ["woofmark@git://github.com/jywarren/woofmark.git#plots2"]. This could result in non-deterministic behavior, skipping. error Command failed. Exit code: 128 Command: git Arguments: ls-remote --tags --heads git://github.com/jywarren/grow.git Directory: /workspace/plots2 Output: fatal: remote error: The unauthenticated git protocol on port 9418 is no longer supported. Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. the i did ran this command to fix the error git config --global url."https://github.com/".insteadOf git://github.com/

than I ran yarn install again for the package to be installed. Afterwards, i tried to start the server again by running passenger start but I got the error below

Screenshot 2022-04-09 at 23 37 24

so I stoped the server again by typing ctr + c then I ran this command rake assets:precompile after that I ran bundle install finally I did this bundle exec rails webpacker:install - it installs webpacker and restart the webpacker server. While running this command bundle exec rails webpacker:install, it will ask you something like this : conflict config/webpacker.yml Overwrite /workspace/plots2/config/webpacker.yml? (enter "h" for help) [Ynaqdhm] please just type n that is saying that you dont want the installation to overwrite the existing file. After that, i started the server again with passenger start and I am in.

Screenshot 2022-04-10 at 00 20 45

Hope this helps

stephaniequintana commented 2 years ago

Thank you, @kumni02. There was similar issue/fix with #10827, Im curious if/how they're related, At any rate, we all appreciate the effort and sharing the details/results.

simransia commented 2 years ago

Wooow @kunmi02 !! You are really really awesome. πŸ’›πŸ’› I followed all the instructions you have given and now the problem is fixed. πŸ’ƒπŸ₯³

Thank You so much for providing help πŸ™‡β€β™€οΈ I highly appreciate it !πŸ₯°

Ademola101 commented 2 years ago

Hi, I am an outreachy aspirant, I am getting this error when installing the plot2 on my local machine.

An error occurred while installing critical-path-css-rails (4.1.1), and Bundler cannot continue. Make sure that gem install critical-path-css-rails -v '4.1.1' --source 'https://rubygems.org/' succeeds before bundling.

Forchapeatl commented 2 years ago

@Ademola101 , can you share a screen shot of the error with us

Ademola101 commented 2 years ago

Screenshot (6) @Forchapeatl this is the error i am getting