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
Gem dependencies are not fully documented in the ReadMe #148
Comments
This is a sort of appendix to the info I gave above in my comment on this issue. Here are the errors I was getting when I tried to run camping homepage.rb before installing the extra gems needed:
|
I love this! Thank you so much. Indeed there are more dependencies for Camping than are mentioned directly. It's recommended to install camping via bundler, and to run via bundler. I've opened a PR to make these changes to the Readme and will merge this today. |
I've opened a PR that should solve this issue. The feature branch with the updated README can be found here, before it's merged into Master. |
Oh wonderful! I didn't know about bundler. Thank you, I looked at your updated README, it's now nice and clear for beginners such as myself. I appreciate you writing the actual commands to use bundler to install Camping, because if someone had just told me to user bundler to install it, I would not have known what to do. |
Please let me know if you need any more help. I'll be releasing Camping 3.1 this week, then time will be dedicated to documentation for the project. |
Thanks! I for the sake of completeness, I tried Bundler but unfortunately it complained about needing write permissions for /var/lib/gems/[...] since that directory is owned by root. I tried bundler as sudo (sudo bundle install) but it said bundler shouldn't be run as root. BTW it's also possible that I didn't have the right files in my camping directory to begin with. I downloaded the Gemfile for camping. Was I supposed to download other files as well, for use with Bundler? This problem is specific only to trying to install camping with bundler. If I install it via just installing the individual gems it needs, it works fine. Don't worry about this problem if it's something that will become clear in the documentation for Camping 3.1, or if it's an issue specific to running bundler (as opposed to something more directly related to Camping). |
Let me help you diagnose this issue. Which platform are you using to install Camping? Is it linux, MacOS, or Windows? Are you using a Ruby version manager at all? Could you upload or share a copy of your working directory on Github so that I can inspect and hope to diagnose the issue? Also Is it possible to upload the error that you're experiencing? Please share as much detail as you can, I'm ready to help you solve the issue completely. |
Oh thank you! Going through the process of answering your questions was incredibly helpful for me as I think in doing so, I have figured out the problem. The TL;DR summary of all the info below is at least for the older versions of Ruby and Camping that I was working with, bundler seems to work but gives some warnings that made me think it wasn't working, and results in a file owned by root in my non-root directory (not sure if that's an issue or not). Also, I will be updating to new versions of Ruby and camping because it turned out I was using older versions of both. Here are answers to your questions:
Linux
No, but I realize that I need to use one, so that will be my next step. My current version of Ruby is 3.0.2.107. I tried to update it using the Synaptic Package Manager, but sadly that was already the most recent version of Ruby in the Synaptic Package Manager. So I will install rvm or something like that so I can get a more recent version of Ruby. Related to this, I realized I have been using Camping v 2.1.532 instead of your most recent release of Camping, sorry. I tried to update the Camping gem to get your most recent version using
I will update these shortly.
Yes, of course. It's at https://github.com/verachell/my-working-directory-for-camping It uses the homepage.rb example given in the Camping repo documentation. If I'm missing any files that I should have added into my working directory, please let me know! I just have those 2 files in my working directory, that's it. The good news is that with the camping 2.1.532 gem installed via gem install (plus the other dependent gems also installed via gem install) then camping works fine. I just type So that's the good news.
Yes, definitely. In that working directory, if I type bundle install, this is what happens:
.
By comparison, if I list the contents of my working directory, it looks like this:
Realizing there is a permission issue going on, I then try to run bundle install with root permissions (sudo bundle install). Here is what happens in my working directory - it warns me against running Bundler as root:
However, I then let it run anyway just to see what happened, and it wound up working in the end, but it produced a Gemfile.lock that was owned by root (in my non-root working directory):
The Gemfile.lock was still readable by the non-root user, so it's probably OK. Here is what the Gemfile.lock looks like:
Ultimately, this seems to work, but gives a scary warning about running bundler as root, so maybe isn't really a problem after all. Thank you for bearing with me! I need to get my versions of Ruby and camping up to date, and to do that I need to install a ruby version manager which I will do next. But at least for the older versions I was working with, bundler seems to work but gives some warnings that made me think it wasn't working. |
Updating what happened after installing a ruby version manager and trying out new version of campingI installed In this situation, However, when I move on and type
In case this is of relevance, when I list gems, the camping gem version is 3.1.3 I don't see this issue as a big problem because I can still get camping to work just fine via the camping command (in this example, |
The issue I see is the Gemfile you're using has Camping's dependencies, but not Camping itself. If you Just add Camping to your Gemfile, then It's dependencies will be installed automatically. Try using this Gemfile: # frozen_string_literal: true
source 'https://rubygems.org'
gem 'camping'
gem 'tilt'
group :test do
gem 'minitest', '~> 5.0'
gem 'minitest-reporters'
gem 'rack-test'
gem 'ruby_parser'
gem 'minitest-hooks'
end Now delete your It's fantastic that you're working with rbenv! This is great! Make sure you are on the latest version of Ruby. I think the expected behaviour is that each version of Ruby that you have will have its own gems, or versions of gems, scoped to the version of Ruby. So if you have I'm saying this because the version of Camping that you use straight from the command line will be different from the bundler version of ruby. So you'll need to Once that is done you'll be just a single step from getting it to work. Rename I hope that clears up the last of the issues you're experiencing. |
Yes! Yes! It's working, yay....! :) I followed your instructions above exactly, and it worked perfectly. Thank you for all your advice, patience and help.
This was excellent advice that is helpful to beginners such as myself. I was unaware that gems are scoped to the version of Ruby, that must be why I lost the camping gem before. And I wasn't aware that the version of camping from the command line could be different from the bundler one until you said. Even more exciting, after doing |
This relates only to the documentation.
As a beginner/noob, I was struggling to get Camping working on my local machine. I followed the installation instructions and installed the gems
camping
,markaby
, andactiverecord
. I then used thehomepage.rb
example but got errors when I typedcamping homepage.rb
(error descriptions below). After looking at the Gemfile for Camping, it seems there are other gem dependencies needed besides the ones mentioned in the ReadMe. I already happened to have some of these installed on my machine but not all. This indeed proved to be the solution - after installing the remaining gems mentioned in the Gemfile, the homepage.rb worked perfectly.Other beginners might also be encountering this problem and not realize that there are other gems needed besides the ones mentioned in the ReadMe.
Perhaps the ReadMe could include something like this to make it more beginner-friendly:
Besides
camping
andmarkaby
, you'll also need the following gems if you don't already have them installed:mab
,rake
,rackup
,rack
, andrack-session
.Note: for rackup and rack, it's best to install rackup first and then rack. Otherwise you may get a warning message about rackup conflicting with rack.
The text was updated successfully, but these errors were encountered: