Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tomoyuki28jp opened this issue Sep 30, 2014 · 5 comments
Open

Comments

@tomoyuki28jp
Copy link

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
Copy link
Collaborator

purcell commented Sep 30, 2014

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
Copy link
Author

@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
Copy link
Collaborator

purcell commented Sep 30, 2014

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
Copy link
Author

@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
Copy link
Collaborator

purcell commented Sep 30, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants