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

Missing dependency github-linguist #40

Closed
jakecraige opened this issue Jan 19, 2015 · 25 comments
Closed

Missing dependency github-linguist #40

jakecraige opened this issue Jan 19, 2015 · 25 comments
Assignees
Labels

Comments

@jakecraige
Copy link

$ octodown README.md
Missing dependency 'github-linguist' for SyntaxHighlightFilter. See README.md for details.
$ ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
$ gem list --local | grep octodown
octodown (1.0.4)

This error comes from https://github.com/jch/html-pipeline and it's referring to this part of the README I'm not sure if that means this gem needs to be bundled with that dependency?

@schwartzmx
Copy link

Also having problems with Linguist, receiving this error after I updated my gems earlier today.

/usr/local/lib/ruby/gems/2.2.0/gems/github-linguist-4.2.6/lib/linguist/blob_helper.rb:224:in `<module:BlobHelper>': undefined method `load_file' for Psych:Module (NoMethodError)
    from /usr/local/lib/ruby/gems/2.2.0/gems/github-linguist-4.2.6/lib/linguist/blob_helper.rb:16:in `<module:Linguist>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/github-linguist-4.2.6/lib/linguist/blob_helper.rb:7:in `<top (required)>'
    from /usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/github-linguist-4.2.6/lib/linguist.rb:1:in `<top (required)>'
    from /usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /usr/local/lib/ruby/gems/2.2.0/gems/html-pipeline-1.11.0/lib/html/pipeline/syntax_highlight_filter.rb:2:in `<top (required)>'
    from /usr/local/lib/ruby/gems/2.2.0/gems/octodown-1.0.4/lib/octodown/renderer/github_markdown.rb:37:in `pipeline'
    from /usr/local/lib/ruby/gems/2.2.0/gems/octodown-1.0.4/lib/octodown/renderer/github_markdown.rb:17:in `to_html'
    from /usr/local/lib/ruby/gems/2.2.0/gems/octodown-1.0.4/lib/octodown/support/helpers.rb:14:in `markdown_to_raw_html'
    from /usr/local/lib/ruby/gems/2.2.0/gems/octodown-1.0.4/lib/octodown/support/helpers.rb:8:in `markdown_to_html'
    from /usr/local/lib/ruby/gems/2.2.0/gems/octodown-1.0.4/bin/octodown:42:in `main'
    from /usr/local/lib/ruby/gems/2.2.0/gems/octodown-1.0.4/bin/octodown:47:in `<top (required)>'
    from /usr/local/bin/octodown:23:in `load'
    from /usr/local/bin/octodown:23:in `<main>'

@ianks ianks added the bug label Jan 19, 2015
@ianks
Copy link
Owner

ianks commented Jan 19, 2015

This is indeed odd. We have gihub-linguist listed as a dependency here. Wonder what is causing this.

What were the steps to recreate this bug?

@ianks
Copy link
Owner

ianks commented Jan 19, 2015

@schwartzmx @jakecraige Can you also try running gem uninstall octodown && gem install octodown

@schwartzmx
Copy link

@ianks I've tried that. In my case I had run sudo gem update earlier and now octodown is throwing those resultant exceptions in particular with linguist.

@ianks
Copy link
Owner

ianks commented Jan 19, 2015

Ah, so that would indicate that the updated Gems were part of system Ruby then? Try sudo gem uninstall octodown && sudo gem install octodown if you haven't already.

@schwartzmx
Copy link

I did, I have a systemwide install of ruby (reason for sudo) because I'm on a Mac and don't actually use ruby so I never messed with the default installation.

@ianks
Copy link
Owner

ianks commented Jan 19, 2015

OK. I'm working on a solution where users won't have to install any Ruby at all to make things work.

In the meantime I will try to figure out what is going on here and see if I can recreate it. Sorry about the hassle.

@schwartzmx
Copy link

@ianks No problem. It is weird that after running sudo gem update it doesn't work, because before it was working flawlessly and it is a great utility to have. Great work man!

@ianks
Copy link
Owner

ianks commented Jan 31, 2015

Did you ever get this fixed @schwartzmx ? Can you try running sudo gem pristine --all

@sanadan
Copy link

sanadan commented Feb 3, 2015

Try to use psych 2.0.8. Does not work when it is newer on Ruby 2.2.0. By the way, it does not occur on Ruby 2.1.5.

@sorrycc
Copy link

sorrycc commented Feb 7, 2015

Same problem with me.

$ gem install octodown
ERROR:  While executing gem ... (Gem::UnsatisfiableDependencyError)
    Unable to resolve dependency: 'github-linguist (~> 4.2.5)' requires 'rugged (~> 0.22.0b4)'

@ches
Copy link

ches commented Feb 13, 2015

@sorrycc That's a bit different of an issue, the one here is after octodown is successfully installed, it can fail to run.

@ianks I think this is triggered when there are fenced code blocks in a file to be rendered with syntax highlighting, I have octodown installed and working for some files, but getting this error on others.

Note that in html-pipeline's README section about github-linguist, it says:

Note: See Gemfile :test block for version requirements.

And here's the relevant Gemfile section, to save you a click:

  if RUBY_VERSION < "2.1.0"
    gem "escape_utils",     "~> 0.3",   :require => false
    gem "github-linguist",  "~> 2.6.2", :require => false
  else
    gem "escape_utils",     "~> 1.0",   :require => false
    gem "github-linguist",  "~> 2.10",  :require => false
  end

octodown sets its dependency on much newer versions of linguist, so apparently html-pipeline's need isn't being satisfied and it's refusing to use the version installed along with octodown.

@ianks
Copy link
Owner

ianks commented Feb 13, 2015

Keen insight. This brings up another issue: we are currently checking in a Gemfile.lock for Travelling Ruby, so dynamically altering the dependencies may be problematical with this implementation.

Maybe we will just move the Lockfile to the pacakging/ dir and move manually when building the Travelling Ruby package. That way we can accommodate Ruby users with lower versions and still be able to build out the TR package. Pinging @FooBarWidget for your thoughts on this.

@FooBarWidget
Copy link
Contributor

Yes that works.

@ches
Copy link

ches commented Feb 13, 2015

Yeah, a Gemfile.lock in the repo makes it more likely that a dependency that you trusted to be SemVer with a fuzzy '~>' in gemspec could break something in a point version, and it won't be surfaced in your development environment or CI, but might be when users install from rubygems. Avoiding that is of course a key benefit of having a Traveling Ruby package instead, but potential trouble if some people still use gem install.

Anyway, that's perhaps a little off topic 😁

@ianks ianks self-assigned this Mar 17, 2015
@ianks ianks closed this as completed in 0541d76 Apr 9, 2015
ianks added a commit that referenced this issue Apr 9, 2015
Only use Gemfile.lock for packaging task [resolves #40]
@ianks ianks removed the in progress label Apr 9, 2015
@ches
Copy link

ches commented Apr 9, 2015

Yay, looking forward to this in a release version.

@ches
Copy link

ches commented May 11, 2015

The original issue still doesn't appear to be fixed, I vote for reopening this issue.

On master, Octodown's github-linguist dependency is:

spec.add_dependency 'github-linguist',     '~> 4.2.5'

While html-pipeline only supports ~> 2.10 (for recent Rubies). I.e. v3 and above are too high.

@ianks ianks reopened this May 11, 2015
@ianks
Copy link
Owner

ianks commented May 11, 2015

Can you see if gem uninstalling, then changing the dependency to ~> 2.10, then running rake install fixes your issue? I'm having trouble recreating it on my end, but if that fixes it for your then I will push a change up today to make sure things are working properly for everyone.

Cheers!

@runar
Copy link

runar commented Jun 25, 2015

I have the same issue:

$ octodown FILE.md
Missing dependency 'github-linguist' for SyntaxHighlightFilter. See README.md for details.

$ ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]

$ gem list --local | grep octodown
octodown (1.1.2)

$ gem list --local | grep github-linguist
github-linguist (4.5.6, 4.2.7, 2.12.0, 2.10.0)

I have tried everything I can think of, including changing the dependency, and running rake install, gem install pkg/octodown-1.1.2.gem, and other commands suggested here.

Is there anything else I can do to make Octodown work?

@ianks
Copy link
Owner

ianks commented Jun 25, 2015

@runar yes there is. I have created self-contained packages for octodown. You can run the octodown executable from there. Let me know if that works for you.

https://github.com/ianks/octodown/releases/tag/v1.1.2

@runar
Copy link

runar commented Jun 26, 2015

@ianks Thank you, but I'm afraid it still doesn't work:

$ ~/Downloads/octodown-1.1.2-osx/octodown
/Users/runar/Downloads/octodown-1.1.2-osx/lib/app/vendor/ruby/2.1.0/gems/posix-spawn-0.3.11/lib/posix/spawn.rb:2:in `require': cannot load such file -- posix_spawn_ext (LoadError)
        from /Users/runar/Downloads/octodown-1.1.2-osx/lib/app/vendor/ruby/2.1.0/gems/posix-spawn-0.3.11/lib/posix/spawn.rb:2:in `<top (required)>'
        from /Users/runar/Downloads/octodown-1.1.2-osx/lib/app/vendor/ruby/2.1.0/gems/pygments.rb-0.6.3/lib/pygments/popen.rb:2:in `require'
        from /Users/runar/Downloads/octodown-1.1.2-osx/lib/app/vendor/ruby/2.1.0/gems/pygments.rb-0.6.3/lib/pygments/popen.rb:2:in `<top (required)>'
        from /Users/runar/Downloads/octodown-1.1.2-osx/lib/app/vendor/ruby/2.1.0/gems/pygments.rb-0.6.3/lib/pygments.rb:1:in `require'
        from /Users/runar/Downloads/octodown-1.1.2-osx/lib/app/vendor/ruby/2.1.0/gems/pygments.rb-0.6.3/lib/pygments.rb:1:in `<top (required)>'
        from /Users/runar/Downloads/octodown-1.1.2-osx/lib/app/lib/octodown/renderer/github_markdown.rb:2:in `require'
        from /Users/runar/Downloads/octodown-1.1.2-osx/lib/app/lib/octodown/renderer/github_markdown.rb:2:in `<top (required)>'
        from /Users/runar/Downloads/octodown-1.1.2-osx/lib/app/lib/octodown.rb:3:in `require'
        from /Users/runar/Downloads/octodown-1.1.2-osx/lib/app/lib/octodown.rb:3:in `<top (required)>'
        from /Users/runar/Downloads/octodown-1.1.2-osx/lib/app/bin/octodown:3:in `require'
        from /Users/runar/Downloads/octodown-1.1.2-osx/lib/app/bin/octodown:3:in `<main>'

Do you want me to create a new issue?

@ianks
Copy link
Owner

ianks commented Jun 26, 2015

Yes that would be good. Can you give you OS specs on there too?

@runar
Copy link

runar commented Jun 27, 2015

Done!

@jvirtanen
Copy link
Contributor

For what it's worth, I hit the same problem when installing the 1.1.2 gem, but master works fine. I'm on Ruby 2.1.3p242.

@sshaw
Copy link

sshaw commented Sep 22, 2015

I haven't used octodown for months (great program, by the way), tried it today and 💥 ran into this issue. Good news is, I figured out the problem.

After receiving the Missing dependency 'github-linguist'... error and doing some basic sanity checking I decided to run linguist:

~/code/elisp/git-link >linguist
/Users/sshaw/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require': dlopen(/Users/sshaw/.rvm/gems/ruby-2.2.1/gems/charlock_holmes-0.7.3/lib/charlock_holmes/charlock_holmes.bundle, 9): Library not loaded: /usr/local/opt/icu4c/lib/libicudata.53.1.dylib (LoadError)
  Referenced from: /Users/sshaw/.rvm/gems/ruby-2.2.1/gems/charlock_holmes-0.7.3/lib/charlock_holmes/charlock_holmes.bundle
  Reason: image not found - /Users/sshaw/.rvm/gems/ruby-2.2.1/gems/charlock_holmes-0.7.3/lib/charlock_holmes/charlock_holmes.bundle
    from /Users/sshaw/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/sshaw/.rvm/gems/ruby-2.2.1/gems/charlock_holmes-0.7.3/lib/charlock_holmes.rb:1:in `<top (required)>'
    from /Users/sshaw/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/sshaw/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/sshaw/.rvm/gems/ruby-2.2.1/gems/github-linguist-4.2.7/lib/linguist/blob_helper.rb:2:in `<top (required)>'
    from /Users/sshaw/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/sshaw/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/sshaw/.rvm/gems/ruby-2.2.1/gems/github-linguist-4.2.7/lib/linguist/file_blob.rb:1:in `<top (required)>'
    from /Users/sshaw/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/sshaw/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Users/sshaw/.rvm/gems/ruby-2.2.1/gems/github-linguist-4.2.7/bin/linguist:6:in `<top (required)>'
    from /Users/sshaw/.rvm/gems/ruby-2.2.1/bin/linguist:23:in `load'
    from /Users/sshaw/.rvm/gems/ruby-2.2.1/bin/linguist:23:in `<main>'
    from /Users/sshaw/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/sshaw/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

So I decided to reinstall icu4c:

~/code/elisp/git-link >brew uninstall icu4c
Uninstalling /usr/local/Cellar/icu4c/55.1... (244 files, 66M)
icu4c 53.1 is still installed.
Remove them all with `brew uninstall --force icu4c`.

Hummm, 55.1 and 53.1

~/code/elisp/git-link >brew uninstall icu4c --force icu4c
Uninstalling icu4c... (241 files, 57M)
~/code/elisp/git-link >brew install icu4c
==> Downloading https://homebrew.bintray.com/bottles/icu4c-55.1.mavericks.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/icu4c-55.1.mavericks.bottle.tar.gz
==> Pouring icu4c-55.1.mavericks.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
...

After this I explicitly uninstalled charlock_holmes, github-linguist and octodown and reinstalled octodown (1.1.2); this fixed it.

I believe the problem here was that between the last time I ran octodown and today, I installed Node and PHP 📉.

If you look at Homebrew's issues, there are various icu4u issues. Here's one. This bumped icu from 53, which is where I was when octodown was working and was what charlock_holmes was linked against, to 55, where it broke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants