public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Steven Penny <svnpenn@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Cygwin Ruby and $LOAD_PATH
Date: Wed, 17 Apr 2019 00:20:00 -0000	[thread overview]
Message-ID: <5cb67130.1c69fb81.6d86f.6716@mx.google.com> (raw)
In-Reply-To: <a645a5daa7d2c4b2e676e3b89005578c6c1d8980.camel@cygwin.com>

On Tue, 16 Apr 2019 09:35:48, Yaakov Selkowitz wrote:
>>     $ org-ruby -d alpha.org
>>     Exception `LoadError' at
>>     /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:54 -
>       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> That doesn't look like it's from Cygwin's rubygems package.

Correct. Not sure how that happened but Ive since deleted the files and
reinstalled. However the error persists:

    $ org-ruby -d alpha.org
    Exception `LoadError' at
    /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55 - cannot load
    such file -- coderay

I found a fix like this:

diff --git a/lib/org-ruby/html_output_buffer.rb
b/lib/org-ruby/html_output_buffer.rb
index 9d6a061..c0d5f2e 100644
--- a/lib/org-ruby/html_output_buffer.rb
+++ b/lib/org-ruby/html_output_buffer.rb
@@ -44,6 +44,7 @@ module Orgmode
         rescue LoadError
           # Pygments is not supported so we try instead with CodeRay
           begin
+            gem 'coderay'
             require 'coderay'
           rescue LoadError
             # No code syntax highlighting

However it turns out that was a red herring. The problem isnt $LOAD_PATH, the
problem is my source file:

    $ cat alpha.org
    #+BEGIN_SRC rust
    fn main() {
       println!("alpha beta");
    }
    #+END_SRC

Coderay does not support Rust currently:

https://github.com/rubychan/coderay/issues/208

If I try again with Ruby code it works fine, even without any patches:

$ cat beta.org
#+BEGIN_SRC ruby
puts 'hello world'
#+END_SRC

$ org-ruby -d beta.org
Exception `LoadError' at
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55 - cannot load such
file -- coderay
<pre class="src" lang="ruby">
puts <span style="background-color:hsla(0,100%,50%,0.05)">
<span style="color:#710">'</span><span style="color:#D20">hello world</span>
<span style="color:#710">'
</span></span>
</pre>

Thanks for the response - sorry for the noise.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

      reply	other threads:[~2019-04-17  0:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  4:01 Steven Penny
2019-04-16 13:35 ` Yaakov Selkowitz
2019-04-17  0:20   ` Steven Penny [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5cb67130.1c69fb81.6d86f.6716@mx.google.com \
    --to=svnpenn@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).