gettalong / kramdown

kramdown is a fast, pure Ruby Markdown superset converter, using a strict syntax definition and supporting several common extensions.
http://kramdown.gettalong.org
Other
1.72k stars 271 forks source link

Could not find gem 'kramdown' in https://github.com/gettalong/kramdown.git #789

Closed anon987654321 closed 1 year ago

anon987654321 commented 1 year ago

Gemfile

gem "kramdown", github: "gettalong/kramdown"

Anybody know? Thanks!

anon987654321 commented 1 year ago

ruby 3.2.2 + Rails 7.1.alpha

gettalong commented 1 year ago

You need to use

gem "kramdown"

without the github specifier.

anon987654321 commented 1 year ago

Hi,

But I always use that specifier as a sort of convention. Among all my hundreds of gems, only Kramdown gives me this problem.

I'll try coming up with a solution. Thanks!

anon987654321 commented 1 year ago

I figured it out and wrote kramdown.gemspec:

# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'kramdown/version'

Gem::Specification.new do |spec|
  spec.name          = "kramdown"
  spec.version       = Kramdown::VERSION
  spec.authors       = ["Thomas Leitner"]
  spec.email         = ["t_leitner@gmx.at"]

  spec.summary       = %q{Kramdown is a fast, pure Ruby Markdown superset converter.}
  spec.description   = %q{Kramdown is a fast, pure Ruby Markdown superset converter, using a strict syntax definition and supporting several common extensions.}
  spec.homepage      = "https://kramdown.gettalong.org/"
  spec.license       = "MIT"

  spec.files         = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
  spec.bindir        = "exe"
  spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
  spec.require_paths = ["lib"]

  spec.add_dependency "coderay", "~> 1.1"
  spec.add_dependency "rouge", "~> 2.0"
end

However then I noticed you have it in your .gitignore, why's that? Having it should offer many benefits:

gettalong commented 1 year ago

So, this is not an "issue". You should, by default, rely only on released versions. If you rely on versions on Github, you might rely on something that is not stable or tested. You can't assume that a repository holds a state that is usable. This might be the case for many but still, mistakes are easy.

What complex installation routine? If you want kramdown, you run gem install kramdown or you specify gem 'kramdown' in your Gemfile. This is neither easier nor harder than any other gem.

So with kramdown you have a conscious choice to make: You use the released version (the easy way) or use a potentially unstable version (the harder way because you need to clone the repo and create a Gemfile). It is up to you.