Don’t feel bad in any way. You are not dumb and this is not easy. You are correct that it is complicated by the combination and permutations of configurations. Or it seems to be so. That can sometimes be a red herring.
On Nov 28, 2021, at 1:02, Greg via TextMate textmate@lists.macromates.com wrote:
Thank you for the detailed explanation. No wonder I keep getting confused by this.
What about `whereis` pointing to `ruby/usr/bin/ruby`? One (at least I) can’t look at the file and see what version it is either. Both of these files are too small, so presumably pointers.
The confusion won’t end of course since we have different OSs and different methods of managing Rubies. If people like Matt are tripped up by this I don’t feel so bad.
I found 17 files named “ruby’ and one name “Ruby” (/System/Library/Frameworks/Ruby.framework/Versions/2.6/Ruby) on my eight year old MBP. I’ve very much an amateur.
On Nov 27, 2021, at 2:09 AM, Jacob Carlborg via TextMate textmate@lists.macromates.com wrote:
On 27 Nov 2021, at 01:00, Matt Neuburg via TextMate textmate@lists.macromates.com wrote:
You cannot mean that I should be installing any gems using the system Ruby. It is off limits, and has been since Catalina. You are _supposed_ to install your own Ruby, and I have done so.
I didn’t say that. I said you should use the version of Ruby that TextMate invokes when invoking that command. It can be system Ruby and it can be something else.
And TextMate _is_ using it. When I run a TextMate ruby script consisting of `puts RUBY_VERSION`, I get `2.6.3`. When I say in the Terminal `ruby --version`, I get
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin20]
Moreover, when I run a TextMate ruby script consisting of
require 'redcarpet' markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, extensions = {}) puts markdown.render("This is *bongos*, indeed.")
I get the expected
<p>This is <em>bongos</em>, indeed.</p>
So I don't think you can deny that TextMate Ruby sees redcarpet. The question is why the GitHub Markdown bundle does not see it.
Running a Ruby script and running a bundle command is not the same thing. When running a Ruby script from within TextMate you’re invoking the “Run” bundle command in the Ruby bundle. This will invoke Ruby 1.8.7 [1], which will invoke the ruby_script.rb [2] script inside the Ruby bundle. This script will later use the TM_RUBY environment variable, if it’s set, or otherwise fall back to what’s in the PATH environment variable to find the appropriate Ruby to execute your script with.
I can just go on using Typora for Markdown, but it would be nice to use TextMate. But I need GitHub-flavored Markdown for this project.
m.
PS It is clear that the GitHub Markdown bundle is working in the sense that if I use code fences with a language, it is correctly formatted in the `.md` file. The problem is that I can't _render_ the Markdown.
When it comes to the Markdown preview command, you can see here [4] that it’s invoking Ruby 1.8.7. As for the redcarpet part, that comes from GitHub-Markdown bundle, which is invoking system Ruby here [5]. If you change [5] to the path of your Ruby 2.6.3p62 it should work.
[1] https://github.com/textmate/ruby.tmbundle/blob/efcb8941c701343f1b2e9fb105c67...
[2] https://github.com/textmate/ruby.tmbundle/blob/efcb8941c701343f1b2e9fb105c67...
[3] https://github.com/textmate/ruby.tmbundle/blob/efcb8941c701343f1b2e9fb105c67...
[4] https://github.com/textmate/markdown.tmbundle/blob/c6b2d79cafcd8619c79acd79a...
[5] https://github.com/textmate/GitHub-Markdown.tmbundle/blob/2b58b061e3a59d794b...
-- /Jacob Carlborg
TextMate mailing list -- textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com
TextMate mailing list -- textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com