eschulte / rinari

Rinari Is Not A Rails IDE (it is an Emacs minor mode for Rails)
http://rinari.rubyforge.org
GNU General Public License v3.0
412 stars 68 forks source link

update 'rails server' in function rinari-web-server #90

Open xlisp opened 9 years ago

xlisp commented 9 years ago

function rinari-web-server is no run in Rails 4 :)

erw7 commented 9 years ago

You use zsh and set PATH in .zshrc? In that case, do not work in the next procedure?

M-: (setq ruby-compilation-executable (executable-find "ruby")) M-x rinaria-web-server

In the case of a non-interactive shell, zsh reads /etc/zshenv and .zshenv. When the PATH which is not right is set in either, rinari-web-server does not work. It is right to do the setting of the PATH of zsh in .zshenv. I think that you should move it to .zshenv if you set it in .zshrc. I think #82 whether probably it is the same cause.

purcell commented 9 years ago

It is right to do the setting of the PATH of zsh in .zshenv. I think that you should move it to .zshenv if you set it in .zshrc.

Agreed, if that's what's happening here.

But it's not clear to me what this patch is trying to do, or why it's necessary. How would I reproduce the problem which this patch fixes?

xlisp commented 9 years ago

@purcell I am use rvm & zsh & mac emacs 24.4 , but I don't know how to do "Emacs path setup" . It's always like this : qq20150503-15

thanks :)

xlisp commented 9 years ago

@erw7 I move my path setting to .zshenv form .zshrc, But Emacs "rinaria-web-server" is no work. thanks :)

➜  ~  echo $PATH
/Users/jim/.rvm/gems/ruby-2.2.0/bin:/Users/jim/.rvm/gems/ruby-2.2.0@global/bin:/Users/jim/.rvm/rubies/ruby-2.2.0/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home//bin:/Users/jim/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jim/Downloads/apache-maven-3.2.5//bin:/Users/jim/.rvm/bin
➜  ~  cat .zshenv
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="robbyrussell"
export PATH=$HOME/bin:/usr/local/bin:$PATH
source $ZSH/oh-my-zsh.sh

I use your command , I't work good :) , but I don't know how setting in path for Emacs.

M-: (setq ruby-compilation-executable (executable-find "ruby")) 
M-x rinaria-web-server

qq20150504-2

And my Rspec is no work :

M-: (executable-find "rake")  # = > "/Users/jim/.rvm/rubies/ruby-2.2.0/bin/rake"
M-: (setq rake-compilation-executable (executable-find "rake")) 
M-x rspec-verify-all # rspec-mode, https://github.com/pezra/rspec-mode

qq20150504-3

erw7 commented 9 years ago
(start-process "foo" buffer "ruby" "some args")

=> PATH set in exec-path of Emacs is used.(run-ruby)

(start-process "foo" buffer "zsh" "-c" "ruby" "some args")

=> PATH set in /etc/zshenv and ~/.zshenv of zsh is used.(ruby-compilation-run)

Therefore I think that PATH set in .zshenv should be used. Is ruby not installed in $HOME/bin or /usr/local/bin?

What happens result of the evaluating ​​next code in the *scratch* buffer .

shell-file-name
(shell-command-to-string "echo $PATH")
(shell-command-to-string "which ruby")
(shell-command-to-string "where ruby")

May be Rspec work next code.

M-: (setq rspec-rake-command (executable-find "rake"))
M-: (setq rspec-spec-command (executable-find "rspec"))
M-x rspec-verify-all

I feel next settings in your init.el that is quick solution.

(setq shell-file-name "/bin/sh")
;; or
(setq shell-file-name "/bin/bash")
xlisp commented 9 years ago

@erw7 I am use your setting , in my init.el , Rspec work is good :+1: , Thanks :)

(setq shell-file-name "/bin/bash")