streeter / markdown-redcarpet.tmbundle

TextMate support for GitHub flavored Markdown
http://github.github.com/github-flavored-markdown/
69 stars 28 forks source link

El Capitan has no Ruby 1.8 #33

Open baburdick opened 9 years ago

baburdick commented 9 years ago
$ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby --version
-bash: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: No such file or directory
$ /usr/bin/env ruby18 --version
env: ruby18: No such file or directory

Replacing these with /usr/bin/env ruby in the relevant files allows one to see styled text and to preview a Markdown Redcarpet document. But printing to PDF or attempting through the print dialog to open in Preview.app causes TextMate (2.0-beta.8) to crash.

diff --git a/Commands/Preview.tmCommand b/Commands/Preview.tmCommand
index 968128d..1596130 100644
--- a/Commands/Preview.tmCommand
+++ b/Commands/Preview.tmCommand
@@ -17,7 +17,7 @@ fi

 # Convert to html then make one of the html tags above caret 
 # into a link that we scroll down to
-"${TM_MARKDOWN:-redcarpet.rb}"|"${TM_SMARTYPANTS:-SmartyPants.pl}"|ruby18 -wKU -e '
+"${TM_MARKDOWN:-redcarpet.rb}"|"${TM_SMARTYPANTS:-SmartyPants.pl}"|ruby -wKU -e '
 lines = STDIN.read.split("\n")
 n = [ENV["TM_LINE_NUMBER"].to_i, lines.length].min - 7

diff --git a/Commands/Title from current file.tmCommand b/Commands/Title from current file.tmCommand
index 3ba080e..a895d9b 100644
--- a/Commands/Title from current file.tmCommand    
+++ b/Commands/Title from current file.tmCommand    
@@ -5,7 +5,7 @@
    <key>beforeRunningCommand</key>
    <string>nop</string>
    <key>command</key>
-   <string>#!/usr/bin/env ruby18 -wKU
+   <string>#!/usr/bin/env ruby -wKU
 title = ENV['TM_FILENAME'].split('.').first
 title.gsub!(/[\-_]([a-zA-Z])/, ' \1')
 title.gsub!(/([a-z])([A-Z])/, '\1 \2')
diff --git a/Support/bin/redcarpet.rb b/Support/bin/redcarpet.rb
index ef12460..746a838 100755
--- a/Support/bin/redcarpet.rb
+++ b/Support/bin/redcarpet.rb
@@ -1,4 +1,4 @@
-#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+#!/usr/bin/env ruby

 # Usage: redcarpet [<file>...]
 # Convert one or more Markdown files to HTML and write to standard output. With
$ /usr/bin/env ruby --version
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]
baburdick commented 9 years ago

And here is the crash report: https://gist.github.com/baburdick/f64745f2d2f513c167bc

mennis commented 8 years ago

Your changes work for me. I am not seeing that crash but it's been a while since you posted this.

El Capitan Version 10.11.4 (15E65) /usr/bin/env ruby --version ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

baburdick commented 8 years ago

It looks like @SteveMarshall has the most active fork for this now: https://github.com/SteveMarshall/markdown-redcarpet.tmbundle

baburdick commented 8 years ago

Just tested his version with my revisions. Still crashing when I try to print a PDF, or open in Preview via the print dialog box.