vigo / textmate2-gfm-preview

GitHub Flavored Markdown Preview for TextMate 2
MIT License
13 stars 1 forks source link

Getting error "You need to set $TM_RUBY variable." #1

Open dturner opened 6 years ago

dturner commented 6 years ago

I have followed the instructions in the README, however, I'm still getting the error "You need to set $TM_RUBY variable." when I attempt to preview a file in TextMate. Here's the output from the terminal to verify that the TM_RUBY variable has been set:

donturner at donturner-macbookpro2 in ~/Library/Application Support/TextMate/Bundles/GFM-Preview.tmbundle/Support on master [!?]
$ defaults write com.macromates.textmate environmentVariables -array-add '{enabled = 1; value = "/Users/donturner/homebrew/bin/ruby"; name = "TM_RUBY"; }'

donturner at donturner-macbookpro2 in ~/Library/Application Support/TextMate/Bundles/GFM- Preview.tmbundle/Support on master [!?]
$ defaults read com.macromates.textmate environmentVariables
( 
    {
        enabled = 1;
        name = "TM_RUBY";
        value = "/Users/donturner/homebrew/bin/ruby";
    }
)

Any ideas what could be causing this?

dturner commented 6 years ago

Also tried going to Prefs->Variables and adding TM_RUBY in manually but still getting the error.

vigo commented 6 years ago

Well, in the terminal, check your ruby:

$ which ruby

Use that in the config... /Users/donturner/homebrew/bin/ruby seems a bit strange to me. How did you install Ruby?

screen_shot_2018-10-07_at_19_06_16
vigo commented 6 years ago

If you don't set the TM_RUBY you can use built-in ruby (which ships with mac os) but you need to install gems via sudo:

git clone https://github.com/vigo/textmate2-gfm-preview.git GFM-Preview.tmbundle
cd GFM-Preview.tmbundle/Support/
sudo bundle install --path vendor/bundle # this line
vigo commented 6 years ago

@dturner can i close the issue?