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

Fix Geminabox::VERSION instantiation failure #514

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nelsnelson
Copy link

See: #506

Getting the following error when using bundler to install and run geminabox.

NameError - uninitialized constant Geminabox::VERSION

Problem is that even though the version.rb module is being required and loaded successfully, some constant VERSION is already defined, and so the Geminabox module never gets to define its version because unless defined? VERSION evaluates to false.

@github-actions
Copy link

github-actions bot commented Mar 1, 2023

You should update this pull request by commenting on it. Otherwise the PR will be closed in 14 days.

Copy link

@pboling pboling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nelsnelson
Copy link
Author

@pboling - It is unclear to me how I might link this PR to its issue: #506

@pboling
Copy link

pboling commented Mar 10, 2023

@pboling I used to think that writing something like "closes #506" in a commit message, or in the PR description, would auto close the issue, but it doesn't seem to be the case currently. :/

@pboling
Copy link

pboling commented Mar 10, 2023

Since this PR is significantly updating the README instructions, I am wondering how I've messed this up, or if we need to also update the docker build command.

❯ vi config.ru
❯ vi Gemfile
❯ bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using bundler 2.4.8
Using faraday-net_http 3.0.2
Using builder 3.2.4
Using httpclient 2.8.3
Using nesty 1.0.2
Using reentrant_flock 0.1.1
Fetching tilt 2.1.0
Using ruby2_keywords 0.0.5
Using rack 2.2.6.3
Using faraday 2.7.4
Using mustermann 2.0.2
Using rack-protection 2.2.4
Installing tilt 2.1.0
Using sinatra 2.2.4
Using geminabox 2.1.0
Bundle complete! 1 Gemfile dependency, 14 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
❯ docker build -t geminabox .

unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /Users/pboling/src/geminabox-srv/Dockerfile: no such file or directory
❯ ls
Gemfile      Gemfile.lock config.ru

The docker build command isn't working. Does it work for other people?

Nevermind - I figured it out. This sentence is really easy to miss:

Move this Dockerfile into a directory that you want to use for your server.

I had even read it, but I had no idea what Dockerfile it was referring to as it never told me to checkout the geminabox source code.

Also it is self-contradictory.

That directory only needs to contain:

config.ru (explained above)
Gemfile
Gemfile.lock

It should instead be:

config.ru (explained above)
Dockerfile (copied from the root of this repo)
Gemfile
Gemfile.lock

@pboling
Copy link

pboling commented Mar 10, 2023

Another issue is that, once I have the docker image built it won't run, using the files as directed in the README. The error is Couldn't find handler for: puma, thin, falcon, webrick. (LoadError), stacktrace below:

2023-03-10 16:25:04 /usr/local/bundle/gems/rack-2.2.6.3/lib/rack/handler.rb:45:in `pick': Couldn't find handler for: puma, thin, falcon, webrick. (LoadError)
2023-03-10 16:25:04     from /usr/local/bundle/gems/rack-2.2.6.3/lib/rack/handler.rb:60:in `default'
2023-03-10 16:25:04     from /usr/local/bundle/gems/rack-2.2.6.3/lib/rack/server.rb:334:in `server'
2023-03-10 16:25:04     from /usr/local/bundle/gems/rack-2.2.6.3/lib/rack/server.rb:255:in `block in logging_middleware'
2023-03-10 16:25:04     from /usr/local/bundle/gems/rack-2.2.6.3/lib/rack/server.rb:413:in `block in build_app'
2023-03-10 16:25:04     from /usr/local/bundle/gems/rack-2.2.6.3/lib/rack/server.rb:412:in `reverse_each'
2023-03-10 16:25:04     from /usr/local/bundle/gems/rack-2.2.6.3/lib/rack/server.rb:412:in `build_app'
2023-03-10 16:25:04     from /usr/local/bundle/gems/rack-2.2.6.3/lib/rack/server.rb:422:in `wrapped_app'
2023-03-10 16:25:04     from /usr/local/bundle/gems/rack-2.2.6.3/lib/rack/server.rb:312:in `block in start'
2023-03-10 16:25:04     from /usr/local/bundle/gems/rack-2.2.6.3/lib/rack/server.rb:379:in `handle_profiling'
2023-03-10 16:25:04     from /usr/local/bundle/gems/rack-2.2.6.3/lib/rack/server.rb:311:in `start'
2023-03-10 16:25:04     from /usr/local/bundle/gems/rack-2.2.6.3/lib/rack

@nelsnelson
Copy link
Author

I also had some trouble getting the server to run outside of docker. Installing all the dependencies in the right places was not as simple as bundle install.

This is why I relied on using docker in the master branch of the cloned project directory, instead.

nelsnelson@neptuno:~/Documents/code$ git clone git@github.com:geminabox/geminabox.git
Cloning into 'geminabox'...
remote: Enumerating objects: 3163, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 3163 (delta 23), reused 33 (delta 13), pack-reused 3116
Receiving objects: 100% (3163/3163), 607.21 KiB | 3.49 MiB/s, done.
Resolving deltas: 100% (1756/1756), done.
nelsnelson@neptuno:~/Documents/code$ cd geminabox
nelsnelson@neptuno:~/Documents/code/geminabox[master]$ docker build -t geminabox .
[+] Building 9.9s (10/10) FINISHED                                                                                                                          
 => [internal] load build definition from Dockerfile                                                                                                   0.0s
 => => transferring dockerfile: 200B                                                                                                                   0.0s
 => [internal] load .dockerignore                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                        0.0s
 => [internal] load metadata for docker.io/library/ruby:3.1.3                                                                                          0.0s
 => [1/5] FROM docker.io/library/ruby:3.1.3                                                                                                            0.0s
 => [internal] load build context                                                                                                                      0.0s
 => => transferring context: 927.76kB                                                                                                                  0.0s
 => CACHED [2/5] RUN mkdir -p /usr/src/app                                                                                                             0.0s
 => CACHED [3/5] WORKDIR /usr/src/app                                                                                                                  0.0s
 => [4/5] COPY . /usr/src/app                                                                                                                          0.0s
 => [5/5] RUN bundle install                                                                                                                           9.7s
 => exporting to image                                                                                                                                 0.2s 
 => => exporting layers                                                                                                                                0.2s 
 => => writing image sha256:4189fb024167d7f9f4f2c55dbcd01af424463ad68b4349bf4f4275d857faea5c                                                           0.0s 
 => => naming to docker.io/library/geminabox                                                                                                           0.0s 
nelsnelson@neptuno:~/Documents/code/geminabox[master]$ docker run --name geminabox --rm -d -p 9292:9292 geminabox:latest
e170ad86e857c98ccc107074ce9c707013b03cc2895fbd19f995d8c5a314c118
nelsnelson@neptuno:~/Documents/code/geminabox[master]$ curl http://localhost:9292   
<!DOCTYPE html>
<html>
  <head>
    <title>Gem in a Box</title>
    <link rel="stylesheet" href="/master.css" type="text/css" media="screen">
    <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Atom Feed">
  </head>
  <body>
    <div id="content">
      <h1>Gem in a Box</h1>
      <p>
<small>If you did not need any credentials to get to this page</small>
  <pre><code>gem sources -a http://localhost:9292/</code></pre>
<small>If you needed some credentials to get to this page</small>
  <pre><code>gem sources -a http://username:password@localhost:9292/</code></pre>
<small>and then ...</small>
  <pre><code>gem install geminabox<br />gem inabox [gemfile]</code></pre>
</p>


<a href="http://localhost:9292/upload">Upload Another Gem</a>
<script type="text/javascript" src="/master.js"></script>

    </div>
  </body>
</html>
nelsnelson@neptuno:~/Documents/code/geminabox[master]$ docker stop geminabox
geminabox
nelsnelson@neptuno:~/Documents/code/geminabox[master]$ docker ps | grep geminabox
nelsnelson@neptuno:~/Documents/code/geminabox[master]$

@nelsnelson
Copy link
Author

nelsnelson commented Mar 11, 2023

I've updated the fork branch commit message to ensure that it includes the phrase "closes #506" but the issue still includes no reference to this PR. I'm perplexed.

Screenshot 2023-03-10 at 10 02 23 PM [Screenshot from: https://github.com//issues/506]

@pboling
Copy link

pboling commented Mar 11, 2023

Oh, lol I think it is because #506 is already closed!

Anyways, thanks for your steps. I'll try that. Would be great to get the readme into a state where a copy pasta setup is functional!

@github-actions
Copy link

You should update this pull request by commenting on it. Otherwise the PR will be closed in 14 days.

@nelsnelson
Copy link
Author

You should update this pull request by commenting on it. Otherwise the PR will be closed in 14 days.

Is there any way that the related pull request could get accepted and this issue subsequently closed appropriately?

@pboling
Copy link

pboling commented May 16, 2023

@tnir This fix is important. Commenting to keep the PR from going stale!

@github-actions
Copy link

You should update this pull request by commenting on it. Otherwise the PR will be closed in 14 days.

@nelsnelson
Copy link
Author

Commenting to keep the PR from going stale.

@nelsnelson
Copy link
Author

Commenting on this PR to prevent it from going stale.

@pboling
Copy link

pboling commented Aug 26, 2023

Looks like we in for a bump every 2 months... unless @tnir can rescue us from the slog.

@nelsnelson
Copy link
Author

Looks like we in for a bump every 2 months... unless @tnir can rescue us from the slog.

I wish I understood what went wrong. I thought I had linked the issue to this PR through the commit message. That worked right? Are we just waiting on the project owner to accept this PR?

@nelsnelson
Copy link
Author

Looks like on Jul 16 @tnir re-opened the linked issue, so now the PR and the issue are in fact linked. Not sure what the next steps are.

@github-actions
Copy link

You should update this pull request by commenting on it. Otherwise the PR will be closed in 14 days.

@pboling
Copy link

pboling commented Oct 26, 2023

Burp.

Copy link

You should update this pull request by commenting on it. Otherwise the PR will be closed in 14 days.

@pboling
Copy link

pboling commented Dec 26, 2023

Particle accelerators.

Copy link

You should update this pull request by commenting on it. Otherwise the PR will be closed in 14 days.

@pboling
Copy link

pboling commented Feb 25, 2024

Meridian lines are tedious abstractions of interstellar malfeasance.

Copy link

You should update this pull request by commenting on it. Otherwise the PR will be closed in 14 days.

@nelsnelson
Copy link
Author

Bumping, please merge the linked PR.

@pboling
Copy link

pboling commented Apr 27, 2024

@tnir Can we turn off the stale bot?

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

Successfully merging this pull request may close these issues.

None yet

2 participants