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

require Failure (Jazzy 0.8.4 only) #891

Closed
SDGGiesbrecht opened this issue Oct 4, 2017 · 4 comments
Closed

require Failure (Jazzy 0.8.4 only) #891

SDGGiesbrecht opened this issue Oct 4, 2017 · 4 comments

Comments

@SDGGiesbrecht
Copy link
Contributor

On my machine, running jazzy _0.8.4_ -version fails with the following output:

~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- CGI (LoadError)
	from ~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from ~/.rvm/gems/ruby-2.4.1/gems/jazzy-0.8.4/lib/jazzy/sourcekitten.rb:5:in `<top (required)>'
	from ~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from ~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from ~/.rvm/gems/ruby-2.4.1/gems/jazzy-0.8.4/lib/jazzy/doc_builder.rb:19:in `<top (required)>'
	from ~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from ~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from ~/.rvm/gems/ruby-2.4.1/gems/jazzy-0.8.4/lib/jazzy.rb:2:in `<top (required)>'
	from ~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from ~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from ~/.rvm/gems/ruby-2.4.1/gems/jazzy-0.8.4/bin/jazzy:13:in `<top (required)>'
	from ~/.rvm/gems/ruby-2.4.1/bin/jazzy:23:in `load'
	from ~/.rvm/gems/ruby-2.4.1/bin/jazzy:23:in `<main>'
	from ~/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `eval'
	from ~/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `<main>'

On the other hand, running jazzy _0.8.3_ -version succeeds. (Ouput: jazzy version: 0.8.3).

I also see that 0.8.4 does work when installed and run on Travis CI’s xcode9 image.

I assume the problem is not really with Jazzy itself, but with my system. However, I have already tried completely wiping and reinstalling Xcode’s command line tools, RVM, Ruby, and Jazzy, and nothing fixed it. I am out of ideas, so any tips on shimming my system back into working order would be appreciated.

In case it matters, I had not tried to use Jazzy since upgrading to Xcode 9, nor had I tried to use 0.8.4 before, so I cannot say for sure if it would ever have worked since either event.

@SDGGiesbrecht
Copy link
Contributor Author

I just tracked the failing line in sourcekitten.rb to this commit between 0.8.3 and 0.8.4.

Still have not found a way to work around it.

@SDGGiesbrecht
Copy link
Contributor Author

Installed Ruby 2.4.2 (which is higher than RVM recommends) to match the working Travis CI build. Then reinstalled Jazzy. Result: Redcarpet seg‐faulted.

Updated all gems. Result: Back to square one with the above output.

@segiddins
Copy link
Collaborator

@SDGGiesbrecht I'm guessing you have a case-sensitive fs -- the file in the stdlib is cgi, not CGI

@SDGGiesbrecht
Copy link
Contributor Author

Yes, I just finished manually navigating to ~/.rvm/gems/ruby-2.4.2/gems/jazzy-0.8.4/lib/jazzy/sourcekitten.rb and changing line 5 from require 'CGI' to require 'cgi' (based on this stackoverflow note) and now Jazzy works fine. (I realize hacking an installed gem is not the wisest, but it will suffice for now.)

And now—thanks to your comment, @segiddins—I also understand why.

I will leave this issue open for now so the workaround can more easily be found by other users with the same problem. Once a fix is released, whoever notices first may close the issue.

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

No branches or pull requests

2 participants