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
413 stars 68 forks source link

rinari-console works with rbenv.el, but rinari-web-server does not. #82

Open tomoyuki28jp opened 10 years ago

tomoyuki28jp commented 10 years ago

rinari-web-server does not use rbenv rails path. How can I fix it?

This is output show in the server buffer:

-*- mode: ruby-compilation; default-directory: "~/app/rails/" -*-
RubyComp started at Tue Sep 30 11:49:35

ruby /Users/user/app/rails/bin/rails server
Could not find rake-10.3.2 in any of the sources
Run `bundle install` to install missing gems.

RubyComp exited abnormally with code 7 at Tue Sep 30 11:49:35

When I run which rails on console, I get this: /Users/user/.rbenv/versions/2.1.0/bin/rails

Mac OS: X 10.9.5 Emacs: 24.3 rbenv: 0.4.0 rinari: master from github

purcell commented 10 years ago

I use rbenv but I don't use rbenv.el, and everything works fine for me, at least with Rails 3.x. What is this bin/rails script? I have a script/rails instead. What Rails version are you using?

When I start

-*- mode: ruby-compilation; default-directory: "~/Projects/myapp/" -*-
RubyComp started at Tue Sep 30 10:32:13

ruby /Users/steve/Projects/myapp/script/rails server
=> Booting WEBrick
=> Rails 3.2.19 application starting in development on http://0.0.0.0:3000

Try evaluating (executable-find "ruby") with M-: in the *server* buffer -- you should get "/Users/user/.rbenv/shims/ruby". If not, then there's a problem with rbenv.el or your Emacs path setup.

tomoyuki28jp commented 10 years ago

@purcell Thanks for your reply!

What Rails version are you using?

I use 4.0.8

Try evaluating (executable-find "ruby") with M-: in the server buffer -- you should get "/Users/user/.rbenv/shims/ruby".

Yes, I get "/Users/user/.rbenv/shims/ruby".

purcell commented 10 years ago

Hmm, then everything should normally just work, if you have a .rbenv-version or .ruby-version file in your project root. But if rbenv.el has set the RBENV_VERSION environment variable to something different, I can imagine that things wouldn't work properly. You can test that with M-: (getenv "RBENV_VERSION").

tomoyuki28jp commented 10 years ago

@purcell Thanks for your reply.

if you have a .rbenv-version or .ruby-version file in your project root.

I didn't have both of the files, so I created .ruby-version, but result is the same.

You can test that with M-: (getenv "RBENV_VERSION").

(getenv "RBENV_VERSION") ; nil
rbenv--modestring ; (" [" #("2.1.0" 0 5 (face rbenv-active-ruby-face)) "]")
(rbenv--active-ruby-version) ; "2.1.0"
purcell commented 10 years ago

I'm not really sure what's going wrong, then, sorry. Note, though, that I don't use rbenv.el, so you could try removing that from the mix.

Otherwise, if you could perhaps provide a minimal emacs init file and steps to reproduce it locally, I can investigate, but without that I'm really just guessing.