Closed dmolesUC closed 2 years ago
Hmm. Does env -u RUBYLIB emacs
make it work?
I'd almost rather go that route, clearing the extra ruby library paths out and sticking with the system ruby. My thought being that it'd be more consistent—there's less ruby versions to support and it should work even if the locally installed ruby gets borked.
Sorry not to get back to this sooner—I had a reasonable workaround and didn't have a reason to mess with it. But now that I'm setting up a new machine…
I don't have $RUBYLIB
in my environment, so env -u RUBYLIB
doesn't make a difference. I tried with RUBY_VERSION
and MY_RUBY_HOME
, but no luck.
My current work around is to use a login shell and rvm use system
first:
#!/bin/bash --login
rvm use system && /Applications/Emacs.app/Contents/MacOS/Emacs "$@"
This is clearly an rvm
-specific workaround, but it doesn't require modifying the Emacs.app distribution, so I think it's cleaner.
Maybe just a note on the Tips and Tricks page that Emacs.app/Contents/MacOS/Emacs
is a Ruby script and Ruby developers may run into some environment problems, with a link to this issue?
I'd like to second the initial request to change the first line to
For some reason system-ruby is quite flakey (i.e. not working) on my 2015 MacBook. Using /usr/bin/env makes all the problems I'm having go away...
@23he FWIW I've switched to emacs-plus, which doesn't get Ruby involved, and have had pretty good luck with it.
The launcher is no longer written in ruby.
Per the Tips And Tricks page, I have a shell script
~/bin/emacs
set up to launch Emacs.app in preference to the system emacs:Every time I launch Emacs from the terminal (either with this script, or directly invoking
/Applications/Emacs.app/Contents/MacOS/Emacs
) I get something like:This is surprisingly difficult to eradicate with
gem pristine
; it seems to have something to do with invoking the system Ruby (/usr/bin/ruby
) in an environment set up for a different Ruby usingrvm
orrbenv
.Editing
/Applications/Emacs.app/Contents/MacOS/Emacs
to replace!#/usr/bin/ruby
with!#/usr/bin/env ruby
causes the script to correctly use thervm
-configured Ruby on my$PATH
, with no errors.