execution problem

29 views
Skip to first unread message

tejo

unread,
Jan 1, 2009, 1:14:12 PM1/1/09
to Rails On Emacs
Hi
I can't execute rails apps with rinari-console etc.
I get a "Missing the Rails gem." error.

I have all the gems installed, rails works, I think the problem is
related to paths.
I define gems and ruby path in my .bash_profile, how I define paths in
rinari....or emacs?

Thanks

Teo

tejo

unread,
Jan 1, 2009, 1:32:40 PM1/1/09
to Rails On Emacs
I get it working with setenv PATH.
I need a way for autoload my PATH from .bash_profile.
BTW I use carbon emacs.

Phil Hagelberg

unread,
Jan 1, 2009, 1:33:22 PM1/1/09
to emacs-o...@googlegroups.com
tejo <m.p...@gmail.com> writes:

> I have all the gems installed, rails works, I think the problem is
> related to paths.
> I define gems and ruby path in my .bash_profile, how I define paths in
> rinari....or emacs?

Your .bash_profile will only take effect within bash and programs that
are started from it. It's a bad idea to put anything in there that isn't
directly related to bash. Use ~/.profile instead. You will have to log
out and log back in for your changes to take effect.

Things are a little different on OS X; someone was telling me there's
really no good way to add to your path without editing some crazy plist
XML file somewhere. I don't use OS X, but if that is the problem then
I'm sure someone else on the list can elaborate.

-Phil

Michael D. Ivey

unread,
Jan 1, 2009, 2:37:39 PM1/1/09
to emacs-o...@googlegroups.com
On Jan 1, 2009, at 12:33 PM, Phil Hagelberg wrote:
> Things are a little different on OS X; someone was telling me there's
> really no good way to add to your path without editing some crazy
> plist
> XML file somewhere. I don't use OS X, but if that is the problem then
> I'm sure someone else on the list can elaborate.


Carbon Emacs appears to load .profile, but the newest HEAD builds of
NS Emacs do not. I finally got this and other env vars working with
the following:


(if window-system
(progn
(ns-grabenv "/bin/bash" '("source ~/.profile" "printenv"))
...
...))

Steve Purcell

unread,
Jan 1, 2009, 2:41:42 PM1/1/09
to emacs-o...@googlegroups.com
Indeed -- here's the trick I use on my Mac, though I think the code
would have the desired effect on any platform:

(dolist (dir (mapcar 'expand-file-name '("/usr/local/bin" "/opt/
local/bin"
"/opt/local/lib/
postgresql83/bin" "~/bin")))
(setenv "PATH" (concat dir ":" (getenv "PATH")))
(setq exec-path (append (list dir) exec-path)))


See http://github.com/purcell/emacs.d/tree/master for the full context.

Michael's trick looks neat too, at the cost of being NextStep/Cocoa-
specific.

-Steve

tejo

unread,
Jan 1, 2009, 4:03:52 PM1/1/09
to Rails On Emacs
Hi, I think I correctly set env path.
Now rinari-console works, even script/server works from a shell
buffer, but if I try rinari-web-server
I get the same error: "Missing the Rails gem. Please `gem install -v=
rails` ......"

any ideas?


On Jan 1, 8:41 pm, Steve Purcell <st...@sanityinc.com> wrote:
> Indeed -- here's the trick I use on my Mac, though I think the code  
> would have the desired effect on any platform:
>
>    (dolist (dir (mapcar 'expand-file-name '("/usr/local/bin" "/opt/
> local/bin"
>                                             "/opt/local/lib/
> postgresql83/bin" "~/bin")))
>      (setenv "PATH" (concat dir ":" (getenv "PATH")))
>      (setq exec-path (append (list dir) exec-path)))
>
> Seehttp://github.com/purcell/emacs.d/tree/masterfor the full context.

Eric Schulte

unread,
Jan 5, 2009, 10:29:15 PM1/5/09
to emacs-o...@googlegroups.com
tejo <m.p...@gmail.com> writes:

> Hi, I think I correctly set env path.
> Now rinari-console works, even script/server works from a shell
> buffer, but if I try rinari-web-server
> I get the same error: "Missing the Rails gem. Please `gem install -v=
> rails` ......"
>

Do you have the RUBYOPT environment variable set to rubygems? You can
check this by executing (environment) from your *scratch* buffer and
then looking at the list in your *messages* buffer.

You can set this by putting

(setenv "RUBYOPT" "rubygems")

in your init file.

If that doesn't fix it I don't know what the issue could be. -- Eric

tejo

unread,
Jan 7, 2009, 8:25:34 AM1/7/09
to Rails On Emacs
Thanks for your reply eric.
I set the env var with (setenv "RUBYOPT" "rubygems") in my init file,
and it's correctly set, I've checked it with M-x getenv.

But I have the same problem =(

"Missing the Rails gem. Please `gem install -v= rails`, update your
RAILS_GEM_VERSION setting in config/environment.rb for the Rails
version you do have installed, or comment out RAILS_GEM_VERSION to use
the latest version installed."

maybe this is an issue with carbon emacs




On Jan 6, 4:29 am, "Eric Schulte" <schulte.e...@gmail.com> wrote:
> tejo <m.pa...@gmail.com> writes:
> > Hi, I think I correctly set env path.
> > Now rinari-console works, even script/server works from a shell
> > buffer, but if I try rinari-web-server
> > I get the same error: "Missing the Rails  gem. Please `gem install -v=
> > rails` ......"
>
> Do you have the RUBYOPT environment variable set to rubygems?  You can
> check this by executing (environment) from your *scratch* buffer and
> then looking at the list in your *messages* buffer.
>
> You can set this by putting
>
>   (setenv "RUBYOPT" "rubygems")
>
> in your init file.
>
> If that doesn't fix it I don't know what the issue could be. -- Eric
>
>
>
> > any ideas?
>
> > On Jan 1, 8:41 pm, Steve Purcell <st...@sanityinc.com> wrote:
> >> Indeed -- here's the trick I use on my Mac, though I think the code  
> >> would have the desired effect on any platform:
>
> >>    (dolist (dir (mapcar 'expand-file-name '("/usr/local/bin" "/opt/
> >> local/bin"
> >>                                             "/opt/local/lib/
> >> postgresql83/bin" "~/bin")))
> >>      (setenv "PATH" (concat dir ":" (getenv "PATH")))
> >>      (setq exec-path (append (list dir) exec-path)))
>
> >> Seehttp://github.com/purcell/emacs.d/tree/masterforthe full context.
Reply all
Reply to author
Forward
0 new messages