asciidoctor / asciidoctor-doctest

:hammer: Test suite for Asciidoctor backends
MIT License
11 stars 16 forks source link

problem running rake #8

Closed jxxcarlson closed 9 years ago

jxxcarlson commented 9 years ago

I upgraded to ruby 2.2.1 and now cannot get doctest to run or run rake install Here is the log

$ rvm list

rvm rubies

   ruby-2.1.2 [ x86_64 ]
=* ruby-2.2.1 [ x86_64 ]
   ruby-2.2.2 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

$ gem install asciidoctor-doctest
Successfully installed asciidoctor-doctest-1.5.2.0
Parsing documentation for asciidoctor-doctest-1.5.2.0
Done installing documentation for asciidoctor-doctest after 0 seconds
1 gem installed
$ rake install
rake aborted!
NameError: uninitialized constant Asciidoctor::DocTest::Latex
/Users/carlson/dev/git/asciidoctor-latex/Rakefile:43:in `block (2 levels) in <top (required)>'
/Users/carlson/.rvm/gems/ruby-2.2.1/gems/asciidoctor-doctest-1.5.2.0/lib/asciidoctor/doctest/generator_task.rb:67:in `initialize'
/Users/carlson/dev/git/asciidoctor-latex/Rakefile:41:in `new'
/Users/carlson/dev/git/asciidoctor-latex/Rakefile:41:in `block in <top (required)>'
/Users/carlson/dev/git/asciidoctor-latex/Rakefile:40:in `<top (required)>'
(See full trace by running task with --trace)
jxxcarlson commented 9 years ago

More on this:

$ gem install asciidoctor-doctest
Successfully installed asciidoctor-doctest-1.5.2.0
Parsing documentation for asciidoctor-doctest-1.5.2.0
Done installing documentation for asciidoctor-doctest after 0 seconds
1 gem installed
$ asciidoctor-doctest -h
-bash: asciidoctor-doctest: command not found
$ asciidoctor-doctest-1.5.2.0 -h
-bash: asciidoctor-doctest-1.5.2.0: command not found
jxxcarlson commented 9 years ago

I've been trying various things, all to no avail. Some logs: (for ruby 2.2.1)

Git error: command `git fetch --force --quiet --tags 'git://github.com/asciidoctor/asciidoctor-doctest.git' "refs/heads/*:refs/heads/*"`
in directory /Users/carlson/.rvm/gems/ruby-2.2.1/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54 has
failed.
If this error persists you could try removing the cache directory
'/Users/carlson/.rvm/gems/ruby-2.2.1/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54'
$ rm -rf /Users/carlson/.rvm/gems/ruby-2.1.2/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54/*
$ rmdir /Users/carlson/.rvm/gems/ruby-2.1.2/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54
$ bundle install
fatal: Not a git repository (or any of the parent directories): .git
Updating git://github.com/asciidoctor/asciidoctor-doctest.git
fatal: Not a git repository (or any of the parent directories): .git
Retrying git fetch --force --quiet --tags 'git://github.com/asciidoctor/asciidoctor-doctest.git' "refs/heads/*:refs/heads/*" due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags 'git://github.com/asciidoctor/asciidoctor-doctest.git' "refs/heads/*:refs/heads/*"` in directory /Users/carlson/.rvm/gems/ruby-2.2.1/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54 has failed.
If this error persists you could try removing the cache directory '/Users/carlson/.rvm/gems/ruby-2.2.1/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54'
fatal: Not a git repository (or any of the parent directories): .git
Retrying git fetch --force --quiet --tags 'git://github.com/asciidoctor/asciidoctor-doctest.git' "refs/heads/*:refs/heads/*" due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags 'git://github.com/asciidoctor/asciidoctor-doctest.git' "refs/heads/*:refs/heads/*"` in directory /Users/carlson/.rvm/gems/ruby-2.2.1/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54 has failed.
If this error persists you could try removing the cache directory '/Users/carlson/.rvm/gems/ruby-2.2.1/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54'
fatal: Not a git repository (or any of the parent directories): .git
Retrying git fetch --force --quiet --tags 'git://github.com/asciidoctor/asciidoctor-doctest.git' "refs/heads/*:refs/heads/*" due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags 'git://github.com/asciidoctor/asciidoctor-doctest.git' "refs/heads/*:refs/heads/*"` in directory /Users/carlson/.rvm/gems/ruby-2.2.1/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54 has failed.
If this error persists you could try removing the cache directory '/Users/carlson/.rvm/gems/ruby-2.2.1/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54'
fatal: Not a git repository (or any of the parent directories): .git
Git error: command `git fetch --force --quiet --tags 'git://github.com/asciidoctor/asciidoctor-doctest.git' "refs/heads/*:refs/heads/*"`
in directory /Users/carlson/.rvm/gems/ruby-2.2.1/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54 has
failed.
If this error persists you could try removing the cache directory
'/Users/carlson/.rvm/gems/ruby-2.2.1/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54'
jxxcarlson commented 9 years ago

Better with ruby 2.1.2 (whch had used previously) but it still will not work:

$ rvm use 2.1.2
Using /Users/carlson/.rvm/gems/ruby-2.1.2
$ bundle install
Fetching git://github.com/asciidoctor/asciidoctor-doctest.git
fatal: Could not parse object 'ab00f83d2bbf4e10c485ce020e34e45b64b36a6c'.
Git error: command `git reset --hard ab00f83d2bbf4e10c485ce020e34e45b64b36a6c` in directory
/Users/carlson/.rvm/gems/ruby-2.1.2/bundler/gems/asciidoctor-doctest-ab00f83d2bbf has failed.
If this error persists you could try removing the cache directory
'/Users/carlson/.rvm/gems/ruby-2.1.2/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54'
$ rm -rf /Users/carlson/.rvm/gems/ruby-2.1.2/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54/*
$ rmdir /Users/carlson/.rvm/gems/ruby-2.1.2/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54
$ bundle install
Fetching git://github.com/asciidoctor/asciidoctor-doctest.git
fatal: Could not parse object 'ab00f83d2bbf4e10c485ce020e34e45b64b36a6c'.
Git error: command `git reset --hard ab00f83d2bbf4e10c485ce020e34e45b64b36a6c` in directory
/Users/carlson/.rvm/gems/ruby-2.1.2/bundler/gems/asciidoctor-doctest-ab00f83d2bbf has failed.
If this error persists you could try removing the cache directory
'/Users/carlson/.rvm/gems/ruby-2.1.2/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54'
jxxcarlson commented 9 years ago

Doctest errors persist. See below. I checked the Rakefile with git blame. It was last modified on 2014-12-10, so changes to the Rakefile can be excluded as a cause. Also, I worked around the fact that I can't use $rake install by doing gem build foo.gemspec and gem install foo.gem. Thus certain other parts of the setup are working.

$ rake -D
rake aborted!
NameError: uninitialized constant Asciidoctor::DocTest::Latex
/Users/carlson/dev/git/asciidoctor-latex/Rakefile:43:in `block (2 levels) in <top (required)>'
/Users/carlson/.rvm/gems/ruby-2.2.1/gems/asciidoctor-doctest-1.5.2.0/lib/asciidoctor/doctest/generator_task.rb:67:in `initialize'
/Users/carlson/dev/git/asciidoctor-latex/Rakefile:41:in `new'
/Users/carlson/dev/git/asciidoctor-latex/Rakefile:41:in `block in <top (required)>'
/Users/carlson/dev/git/asciidoctor-latex/Rakefile:40:in `<top (required)>'
(See full trace by running task with --trace)
jirutka commented 9 years ago

Sorry for late response, GitHub aberrantly haven’t notified me about issues in DocTest. I’ll take a look at this during weekend.

Don’t hesitate to ping me on Twitter when I’m not responding on issues.

jxxcarlson commented 9 years ago

Thanks! I've narrowed things down a bit. I get the error

NameError: uninitialized constant Asciidoctor::DocTest::Latex

if I run rake install or even rake WHATEVER. However, if I make this modification:

  namespace :generate do
=begin
    DocTest::GeneratorTask.new(:latex) do |t|
      t.converter_opts[:backend_name] = :latex
      t.output_suite = DocTest::Latex::ExamplesSuite.new(examples_path: 'test/examples/tex')
      t.examples_path.unshift 'test/examples/adoc'  # extra input examples
    end
=end
    DocTest::GeneratorTask.new(:html) do |t|
      t.converter_opts[:backend_name] = :html
      t.output_suite = DocTest::HTML::ExamplesSuite.new(examples_path: 'test/examples/html')
      t.examples_path = ['test/examples/asciidoc-html']  # input examples
    end
  end

then I can run rake install, rake doctest:html

I am going to to try to make a push this week to get asciidoctor-latex ready for a release.

PS. I tested this is a fresh install of ruby etc and a clone of the latest repo, all on a different computer from the one I usually use.

jirutka commented 9 years ago

Sorry again, I totally forgot about it this time. :(

$ gem install asciidoctor-doctest Successfully installed asciidoctor-doctest-1.5.2.0 Parsing documentation for asciidoctor-doctest-1.5.2.0 ... NameError: uninitialized constant Asciidoctor::DocTest::Latex

This obviously can’t work, because there’s no Latex support in DocTest 1.5.2.0. You must use version from git in branch latex for now. The problem is that you can’t reference gem from git repo in gemspec.

$ asciidoctor-doctest -h -bash: asciidoctor-doctest: command not found

DocTest doesn’t provide any executable asciidoctor-doctest, so this also can’t work (and never did).

Git error: command git fetch --force --quiet --tags 'git://github.com/asciidoctor/asciidoctor-doctest.git' "refs/heads/*:refs/heads/*" in directory /Users/carlson/.rvm/gems/ruby-2.2.1/cache/bundler/git/asciidoctor-doctest-c0e9a1ae48d8882b6553627a66e2866f4be28a54 has failed.

There’s no commit c0e9a1ae48d8882b6553627a66e2866f4be28a54 in DocTest repo, so this can’t work either. However, this is partly my fault, because I should not rebase branches that someone is using, it causes problems like this. :( Delete Gemfile.lock and run bundle install again.

I hope that I will (finally) complete a huge refactoring of DocTest this week, add Latex support and publish new version. This will simplify a lot of things and solve these problems of using DocTest from git branch.

jxxcarlson commented 9 years ago

All working per your directions -- thanks so much (actually, HUGE THANKS). I look forward to the next release.