0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ubuntu上のEmacsにrbenvを認識させる設定

Last updated at Posted at 2021-12-29

情報が古かったり断片的だったりするので、簡易的にまとめる。

前提

環境
Ubuntu 20.04.3 LTS
rbenv 1.1.1
ruby 3.0.0

rbenvとrubyのインストールについては省略

PATHを通す

まず、PATHを通す。

~/.bash_profileに

export PATH="~/.rbenv/shims:/usr/bin:$PATH"
eval "$(rbenv init -)"

そして再起動か、即時反映させる場合

$ source ~/.bash_profile

Emacsの設定

次にEmacsの設定ファイルである
~/init.elに

init.el
(setenv "PATH" (concat (getenv "HOME") "/.rbenv/shims:"
                       (getenv "HOME") "/.rbenv/bin:" (getenv "PATH")))
(setq exec-path (cons (concat (getenv "HOME") "/.rbenv/shims")
                      (cons (concat (getenv "HOME") "/.rbenv/bin") exec-path)))

以上でEmacsにrbenvが認識されると思う。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?