adamcooke / staytus

💡 An open source solution for publishing the status of your services
http://staytus.co
MIT License
2.17k stars 285 forks source link

Gemfile.lock blocks all installations and upgrades #367

Open SuperSajuuk opened 3 years ago

SuperSajuuk commented 3 years ago

Hello. The Gemfile.lock requirement is now blocking all installation and upgrade of Staytus. It is specifying a version of mimemagic that has been removed because of licensing issues. Attempting to use the last oldest version [0.3.7] does not work because editing the lock file to fix the version issue causes this error to be thrown:

Downloading mimemagic-0.3.7 revealed dependencies not in the API or the lockfile (nokogiri (~> 1.11.2)).
Either installing with `--full-index` or running `bundle update mimemagic` should fix the problem.

Using either command still fails to work, either with the same error message or other random issues that are blocking bundle commands from completing.

At this point, without guidance on how to correct this problem, I cannot start my Staytus instance any more, as I'm coming across the issue after having upgraded to Ruby 2.7 from 2.4

SuperSajuuk commented 3 years ago

For anyone reading this who wants a fix, do the following: I recommend only doing this if you feel confident making changes!

  1. Run the following command after using cd to wherever you have installed Staytus on your machine: git pull origin master
  2. Delete the Gemfile.lock, you will remake it in a minute using commands.
  3. Use a text editor to edit the Gemfile file.
  4. In the file, add the following statements:
    gem 'mimemagic', '~> 0.3.7'
    gem 'nokogiri', '~> 1.11.2'
  5. Save the file.
  6. At this point, if you try to do bundle commands, you will get errors about files being changed. To fix this, go to .bundle and edit the config file.
  7. Change "BUNDLE_DEPLOYMENT" from true to false. Save the file.
  8. Run git commit -a -m "your message". This will update your local copy of the pulled origin which bundle commands seem to rely upon.
  9. Run bundle install --without development:test. If you put deployment in, the command will fail due to "changing your gemfile". If this command fails because of an error about being unable to find a specific bundler version, edit the Gemfile.lock to remove the "Bundled with" dependency.
  10. Once completed, run bundle normally to ensure its completed.
  11. Now run bundle exec rake staytus:build staytus:upgrade
  12. Restart your Staytus instance using whatever web server solution you are using to run it.

Why do I need to do this? Basically, as explained, the defined version of mimemagic does not exist. However, trying to use newer versions requires a specific nokogiri, which leads to an error like the above. To get around the profile, you have to specify the gem versions of nokogiri and mimemagic to use, but because you have pulled from a git origin, you have to tell your local repo copy that its up-to-date.

Hopefully the maintainer can fix this with priority, as a lot of other ruby apps have been impacted by the mimemagic issue.

SuperSajuuk commented 3 years ago

@adamcooke i tried to ping you in the above but i broke the formatting of the post so I don't think it went through. Important that this be fixed 👍