Closed bnsv closed 3 years ago
And what happens if you use M-!
to run bundle exec rails server
?
It throws the same error ie (Gem::GemNotFoundException). I also make sure to bundle exec rails server
via terminal and its working well.
But wait, I try the bundler.el again using M-x bundle-install
it throws the same error. when i do M-x bundle-version
it return 2.1.4. I dont have bundler 2.1.4 anymore, I already uninstalled it (gem cleanup bundler).
$ gem list bundler
*** LOCAL GEMS ***
bundler (default: 2.2.29)
When I M-x bundle-gemfile
to some of my project gemfile, then bundle install
it. it throws:
Your Ruby version is 2.5.1, but your Gemfile specified 2.6.6
I dont even have Ruby v2.5.1. Mine is only 2.6.6 & system. and it is true that ruby is set to 2.6.6 in the project gemfile (v2.5.1 wont work with Rails 6).
$ rbenv versions
system
* 2.6.6 (set by ~/latihan/rubee/anoto/rel604/.ruby-version)
Now, when I do run server and also (M-x bundle exec rails s) the error is also change to:
-*- mode: projectile-rails-server; default-directory: "~/latihan/rubee/anoto/rel604/" -*-
Projectile Rails Server started at Mon Oct 25 16:40:17
bundle exec rails server
Your Ruby version is 2.5.1, but your Gemfile specified 2.6.6
Projectile Rails Server exited abnormally with code 18 at Mon Oct 25 16:40:18
Sounds like Emacs only sees the system Ruby. So probably rbenv
is setting the PATH to include the 2.6.6 version, but your rbenv
setup isn't getting invoked when Emacs runs processes. This could be for various reasons, e.g. perhaps Emacs uses a different shell from your terminal, so it doesn't see the same startup files. You can use C-h v
to look at exec-path
, and if you set exec-path-from-shell-debug
to t
then run exec-path-from-shell-initialize
, you'll get some diagnostic info in your *Messages*
buffer.
None of this is related to projectile-rails
, though, just to be clear.
Alright then. Thank a lot Mr Purcell for your helping instructions and I apologize for misjudging which package or what causing the error simply because apparently projectile-rails throws it. I will close the issue now. Thank you for your time.
Hi. When I try to run console or server it wont work, it throws:
Btw, bundler.el recognize the bundler gem (inside emacs) and return the version correctly. Also when I run bundle or server in terminal everything is working well. I already have latest bundler installed but 'projectile-rails' wont recognize it. I thought it was about different PATH approach betwen shell and emacs so I also set this in my init.el but stiil not works.