* Cygwin Ruby and $LOAD_PATH
@ 2019-04-16 4:01 Steven Penny
2019-04-16 13:35 ` Yaakov Selkowitz
0 siblings, 1 reply; 3+ messages in thread
From: Steven Penny @ 2019-04-16 4:01 UTC (permalink / raw)
To: cygwin
Cygwin Ruby $LOAD_PATH is under "/usr":
$ ruby -e 'puts $LOAD_PATH' | sort
/usr/lib/ruby/2.3.0
/usr/lib/ruby/vendor_ruby/2.3.0
/usr/local/lib/ruby/site_ruby/2.3.0
/usr/local/share/ruby/site_ruby
/usr/share/gems/gems/did_you_mean-1.0.2/lib
/usr/share/ruby/2.3.0
/usr/share/ruby/vendor_ruby
/usr/share/rubygems
but Gems get installed to "/home":
$ gem install org-ruby coderay
$ gem which org-ruby coderay
/home/Steven/.gem/ruby/2.3.0/gems/org-ruby-0.9.12/lib/org-ruby.rb
/home/Steven/.gem/ruby/2.3.0/gems/coderay-1.1.2/lib/coderay.rb
This causes the Gems to not be found:
$ cat alpha.org
#+BEGIN_SRC rust
fn main() {
println!("alpha beta");
}
#+END_SRC
$ org-ruby -d alpha.org
Exception `LoadError' at
/usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:54 -
cannot load such file -- coderay
--
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Cygwin Ruby and $LOAD_PATH
2019-04-16 4:01 Cygwin Ruby and $LOAD_PATH Steven Penny
@ 2019-04-16 13:35 ` Yaakov Selkowitz
2019-04-17 0:20 ` Steven Penny
0 siblings, 1 reply; 3+ messages in thread
From: Yaakov Selkowitz @ 2019-04-16 13:35 UTC (permalink / raw)
To: cygwin
On Mon, 2019-04-15 at 21:01 -0700, Steven Penny wrote:
> Cygwin Ruby $LOAD_PATH is under "/usr":
> but Gems get installed to "/home":
Correct, just as on Linux.
> This causes the Gems to not be found:
WFM.
>
> $ 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.
--
Yaakov
--
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Cygwin Ruby and $LOAD_PATH
2019-04-16 13:35 ` Yaakov Selkowitz
@ 2019-04-17 0:20 ` Steven Penny
0 siblings, 0 replies; 3+ messages in thread
From: Steven Penny @ 2019-04-17 0:20 UTC (permalink / raw)
To: cygwin
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-17 0:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16 4:01 Cygwin Ruby and $LOAD_PATH Steven Penny
2019-04-16 13:35 ` Yaakov Selkowitz
2019-04-17 0:20 ` Steven Penny
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).