unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* can one run tk/Ruby gui code from an emacs shell with compile?
@ 2005-11-18 17:11 anne001
  2005-11-18 18:18 ` Peter Dyballa
  0 siblings, 1 reply; 15+ messages in thread
From: anne001 @ 2005-11-18 17:11 UTC (permalink / raw)


I have a small test snipet which runs fine from the terminal prompt
(mac os 10.3.5)
but I can't get it to run from emacs. when I try to compile it in emacs
I get the error
message

/usr/lib/ruby/1.6/tk.rb:7:in `require': No such file to load --
tcltklib (LoadError)
	from /usr/lib/ruby/1.6/tk.rb:7
	from dudruby3.rb:1:in `require'
	from dudruby3.rb:1

I asked for help on the ruby language group and someone thought that
> During compilation invoked from emacs?  You need to check that you
> are getting the correct shell and environment [variables] when emacs
> calls out to the shell to do things.

Does someone on this list know about such things? It just seems ruby on
emacs does not find the
library, while ruby at the terminal does. I don't know where the
libraries are or their names, so I can't help my system much. Or could
it be that emacs is a different ruby from the terminal? panther does
come with an older ruby which I don't know how to uninstall.

Here is my test snipet. I am using ruby 1.8.3  which has a
/ext/tcltklib directory in the raw source which comes with a readme
file I cannot interpret.

require 'tk'
root = TkRoot.new
button = TkButton.new(root) {
text "Hello,Anne"
command proc { puts "I said"}
}
button.pack 
Tk.mainloop

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-18 17:11 anne001
@ 2005-11-18 18:18 ` Peter Dyballa
  2005-11-18 18:51   ` Anne G
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Dyballa @ 2005-11-18 18:18 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 18.11.2005 um 18:11 schrieb anne001:

> I have a small test snipet which runs fine from the terminal prompt
> (mac os 10.3.5)
> but I can't get it to run from emacs. when I try to compile it in emacs
> I get the error
> message
>
> /usr/lib/ruby/1.6/tk.rb:7:in `require': No such file to load --
> tcltklib (LoadError)
>

Which Emacs are you using? Carbon, Cocoa/Aqua, X11, or Apple's 
/usr/bin/emacs which only runs in a terminal?

You could do this, once in Terminal, once in Emacs' shell:

	env | sort -o Terminal.environment
	env | sort -o Emacs.environment

Finally do somewhere (would work in Emcas with ediff too):

	diff Terminal.environment Emacs.environment

This would reveal differences in the runtime environments and might 
lead you to the difference that causes the different behaviour. Once 
you've found that difference you can record it in 
~/.MacOSX/environment.plist (see Apple's 
http://developer.apple.com/qa/qa2001/qa1067.html). This file is read by 
Mac OS X applications (like Carbon or Cocoa/Aqua Emacsen) and helps 
them to find things in the UNIX world. It won't help /usr/bin/emacs or 
GNU Emacs in X11 ...

Are you using different shells in Emacs and in Terminal?

How are you executing Ruby? From inside a Makefile?

--
Greetings

   Pete

There's no place like ~
                           (UNIX Guru)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-18 18:18 ` Peter Dyballa
@ 2005-11-18 18:51   ` Anne G
  2005-11-18 19:53     ` Peter Dyballa
  0 siblings, 1 reply; 15+ messages in thread
From: Anne G @ 2005-11-18 18:51 UTC (permalink / raw)
  Cc: help-gnu-emacs

> Which Emacs are you using? Carbon, Cocoa/Aqua, X11, or Apple's
> /usr/bin/emacs which only runs in a terminal?

I downloaded the panther version from here
http://home.att.ne.jp/alpha/z123/emacs-mac-e.html
"this is GNU Emacs 22.0.50.1 (powerpc-apple-darwin7.9.0) of
2005-09-26 on trio.local

>
> You could do this, once in Terminal, once in Emacs' shell:
>
> 	env | sort -o Terminal.environment
> 	env | sort -o Emacs.environment
>
> Finally do somewhere (would work in Emcas with ediff too):
>
> 	diff Terminal.environment Emacs.environment
I use esc shell to open a shell, changed to ~/ so the two
files would write to the same directory.

diff Terminal.environment Emacs.environment
0a1,8
> ASPELL_CONF=prefix
/Applications/Emacs.app/Contents/Resources;data-dir
/Applications/Emacs.app/Contents/Resources/lib/aspell-0.60;dict-dir
/Applications/Emacs.app/Contents/Resources/lib/aspell-0.60;conf-dir
/Applications/Emacs.app/Contents/Resources/etc
> COLUMNS=80
>
DYLD_LIBRARY_PATH=/Applications/Emacs.app/Contents/Resources/lib
> EMACS=t
> EMACSDATA=/Applications/Emacs.app/Contents/Resources/etc
> EMACSDOC=/Applications/Emacs.app/Contents/Resources/etc
>
EMACSLOADPATH=/Applications/Emacs.app/Contents/Resources/lisp:/Applications/Emacs.app/Contents/Resources/leim:/Applications/Emacs.app/Contents/Resources/site-lisp
>
EMACSPATH=/Applications/Emacs.app/Contents/MacOS/libexec:/Applications/Emacs.app/Contents/MacOS/bin
2,3c10,12
< LOGNAME=anne
< PATH=/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin
---
> INFOPATH=/Applications/Emacs.app/Contents/Resources/info
> OLDPWD=/Users/anne/Desktop
>
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/anne:/usr/local/bin:/usr/X11R6/bin
8,10c17,18
< TERM=xterm
< TERM_PROGRAM=Apple_Terminal
< TERM_PROGRAM_VERSION=100.1.6
---
> TERM=dumb
> TERMCAP=

I would think that I want the PATH in emacs to be the same
as the path in terminal. But the shorter one is the terminal
one which works, and it is included in the longer path emacs
uses.

What is causing the problem?

>
> This would reveal differences in the runtime environments and might
> lead you to the difference that causes the different behaviour. Once
> you've found that difference you can record it in
> ~/.MacOSX/environment.plist (see Apple's
> http://developer.apple.com/qa/qa2001/qa1067.html). This file is read by
> Mac OS X applications (like Carbon or Cocoa/Aqua Emacsen) and helps
> them to find things in the UNIX world. It won't help /usr/bin/emacs or
> GNU Emacs in X11 ...

>
> Are you using different shells in Emacs and in Terminal?
I don't know, I was not really using a shell, did not know
you could.
>
> How are you executing Ruby? From inside a Makefile?
just using the compile command on the menu
compile ruby myfilename.rb

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-18 18:51   ` Anne G
@ 2005-11-18 19:53     ` Peter Dyballa
  2005-11-19  0:56       ` Anne G
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Dyballa @ 2005-11-18 19:53 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 18.11.2005 um 19:51 schrieb Anne G:

> What is causing the problem?
>

That's the culprit: DYLD_LIBRARY_PATH!

DYLD_LIBRARY_PATH is a variable that tells programmes which need to  
load dynamic libraries where to find them. Usually if you *need* to set  
it, it is set up from many path elements which name all directories  
with such libraries. Here it is probably ab-used because aspell does  
not work. I don't think this is the right way.

I found it myself in my copy. I am using this correction:

	in Emacs' shell do: echo $SHELL
	
	then create a file .emacs_<this shell name, i.e. the remainder when  
you subtract /bin/> (could be: .emacs_tcsh, .emacs_bash)

	put into this file just one statement, for .emacs_tcsh: unsetenv  
DYLD_LIBRARY_PATH, for .emacs_bash: unset DYLD_LIBRARY_PATH (that's  
probably correct, I am no bash user)

If you see DYLD_LIBRARY_PATH still set (env | grep DYLD_LIBRARY_PATH)  
then do by hand the 'unset DYLD_LIBRARY_PATH'. I don't know when  
DYLD_LIBRARY_PATH is set, hopefully it only affects the shell and  
nothing else. If Ruby still can't find its library, then remove or  
rename  
/Applications/Emacs.app/Contents/Resources/share/emacs/22.0.50/site- 
lisp/site-start.d/carbon-emacs-builtin-aspell.el and  
/Applications/Emacs.app/Contents/Resources/share/emacs/22.0.50/site- 
lisp/site-start.d/carbon-emacs-builtin-aspell.elc -- that's the culprit  
file(s). (Putting them aside should not hurt much, I presume aspell  
won't work either. And probably it would be better to install  
CocoaAspell for spell-checking texts.)

If all fails, there are other Emacsen for Mac OS X. For example one  
with an Aqua/Cocoa interface (based on Unicode Emacs 23 -- which needs  
to be compiled first).

If you find some time, please send a bug report (together with a  
description of the cure) to  
mailto:macemacsjp-english@lists.sourceforge.jp -- could be you first  
need to subscribe. You'll find in the Help menu a Carbon department,  
which will take you (or your browser) the right web site.

--
Greetings

   Pete

Never be led astray onto the path of virtue.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-18 19:53     ` Peter Dyballa
@ 2005-11-19  0:56       ` Anne G
  2005-11-19  9:48         ` Peter Dyballa
  0 siblings, 1 reply; 15+ messages in thread
From: Anne G @ 2005-11-19  0:56 UTC (permalink / raw)
  Cc: help-gnu-emacs

Thank you for your help.

I followed your instructions and created an .emacs_bash file
in /user/anne with unset DYLD.. .

I believe it did work in removing the dyld path
ASPELL_CONF=prefix
/Applications/Emacs.app/Contents/Resources;data-dir
/Applications/Emacs.app/Contents/Resources/lib/aspell-0.60;dict-dir
/Applications/Emacs.app/Contents/Resources/lib/aspell-0.60;conf-dir
/Applications/Emacs.app/Contents/Resources/etc
COLUMNS=80
EMACS=t
EMACSDATA=/Applications/Emacs.app/Contents/Resources/etc
EMACSDOC=/Applications/Emacs.app/Contents/Resources/etc
EMACSLOADPATH=/Applications/Emacs.app/Contents/Resources/lisp:/Applications/Emacs.app/Contents/Resources/leim:/Applications/Emacs.app/Contents/Resources/site-lisp
EMACSPATH=/Applications/Emacs.app/Contents/MacOS/libexec:/Applications/Emacs.app/Contents/MacOS/bin
HOME=/Users/anne
INFOPATH=/Applications/Emacs.app/Contents/Resources/info
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/anne:/usr/local/bin:/usr/X11R6/bin
PWD=/Users/anne
SHELL=/bin/bash
SHLVL=1
TERM=dumb
TERMCAP=
USER=anne
_=/usr/bin/env
__CF_USER_TEXT_ENCODING=0x1F6:0:0

But compile still can't find tcltklib from emacs.

I am going to upgrade to Tiger on monday. It will have ruby
1.8.2 I will try to reinstall emacs, and see if it is the
same in tiger. Maybe my problem will go away. I will let you
know what happens as soon as the computer is operative
again.

thank you so much for looking into this as you did

anne





On Fri, 18 Nov 2005, Peter Dyballa wrote:

>
> Am 18.11.2005 um 19:51 schrieb Anne G:
>
> > What is causing the problem?
> >
>
> That's the culprit: DYLD_LIBRARY_PATH!
>
> DYLD_LIBRARY_PATH is a variable that tells programmes which need to
> load dynamic libraries where to find them. Usually if you *need* to set
> it, it is set up from many path elements which name all directories
> with such libraries. Here it is probably ab-used because aspell does
> not work. I don't think this is the right way.
>
> I found it myself in my copy. I am using this correction:
>
> 	in Emacs' shell do: echo $SHELL
>
> 	then create a file .emacs_<this shell name, i.e. the remainder when
> you subtract /bin/> (could be: .emacs_tcsh, .emacs_bash)
>
> 	put into this file just one statement, for .emacs_tcsh: unsetenv
> DYLD_LIBRARY_PATH, for .emacs_bash: unset DYLD_LIBRARY_PATH (that's
> probably correct, I am no bash user)
>
> If you see DYLD_LIBRARY_PATH still set (env | grep DYLD_LIBRARY_PATH)
> then do by hand the 'unset DYLD_LIBRARY_PATH'. I don't know when
> DYLD_LIBRARY_PATH is set, hopefully it only affects the shell and
> nothing else. If Ruby still can't find its library, then remove or
> rename
> /Applications/Emacs.app/Contents/Resources/share/emacs/22.0.50/site-
> lisp/site-start.d/carbon-emacs-builtin-aspell.el and
> /Applications/Emacs.app/Contents/Resources/share/emacs/22.0.50/site-
> lisp/site-start.d/carbon-emacs-builtin-aspell.elc -- that's the culprit
> file(s). (Putting them aside should not hurt much, I presume aspell
> won't work either. And probably it would be better to install
> CocoaAspell for spell-checking texts.)
>
> If all fails, there are other Emacsen for Mac OS X. For example one
> with an Aqua/Cocoa interface (based on Unicode Emacs 23 -- which needs
> to be compiled first).
>
> If you find some time, please send a bug report (together with a
> description of the cure) to
> mailto:macemacsjp-english@lists.sourceforge.jp -- could be you first
> need to subscribe. You'll find in the Help menu a Carbon department,
> which will take you (or your browser) the right web site.
>
> --
> Greetings
>
>    Pete
>
> Never be led astray onto the path of virtue.
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-19  0:56       ` Anne G
@ 2005-11-19  9:48         ` Peter Dyballa
  2005-11-19 11:32           ` Anne G
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Dyballa @ 2005-11-19  9:48 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 19.11.2005 um 01:56 schrieb Anne G:

> But compile still can't find tcltklib from emacs.

Could be the Makefile uses the wrong name. On my Panther system there 
is no file with the string tcltklib in it. There too is a TclTk add-on 
for Mac OS X: http://tcltkaqua.sourceforge.net/

>
> I am going to upgrade to Tiger on monday. It will have ruby
> 1.8.2 I will try to reinstall emacs, and see if it is the
> same in tiger.
>

You probably know there there is a Tiger version of the Japanese Carbon 
Emacs ...


There is a general list for Emacs on Mac OS X too:

---------------------------- Info -----------------------------
List Post: <mailto:macosx-emacs@email.esm.psu.edu>
List Archives: <http://dir.gmane.org/gmane.emacs.macintosh.osx>

--
Greetings

   Pete

Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we. -- Georges W. Bush

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-19  9:48         ` Peter Dyballa
@ 2005-11-19 11:32           ` Anne G
  2005-11-19 12:18             ` Peter Dyballa
  0 siblings, 1 reply; 15+ messages in thread
From: Anne G @ 2005-11-19 11:32 UTC (permalink / raw)
  Cc: help-gnu-emacs

> > But compile still can't find tcltklib from emacs.
>
> Could be the Makefile uses the wrong name. On my Panther system there
> is no file with the string tcltklib in it. There too is a TclTk add-on
> for Mac OS X: http://tcltkaqua.sourceforge.net/

tcltklib is a folder in the 1.8.3 source folder in ext
directory. I find it on my system as a bundle.

I was worried that emacs might be using the ruby 1.6 which
comes as a default on panther, so I deleted two folders that
had 1.6 in it, and checked terminal still runs my snipet.

Now the error message in emacs  has changed:
dudruby3.rb:1:in `require': No such file to load -- tk
(LoadError) from dudruby3.rb:1

So emacs was using 1.6 instead of 1.8.3 before!

But somehow removing the couple 1.6 directories did not
solve my problem, just changed it a bit. Now it does not
know what to do with require tk at all.

The DLY directory line seems permanently removed.
>
> >
> > I am going to upgrade to Tiger on monday. It will have ruby
> > 1.8.2 I will try to reinstall emacs, and see if it is the
> > same in tiger.
> >
>
> You probably know there there is a Tiger version of the Japanese Carbon
> Emacs ...

http://home.att.ne.jp/alpha/z123/emacs-mac-e.html

I think this is what you mean. It is the same emacs I
downloaded except I would download the tiger version.

>
>
> There is a general list for Emacs on Mac OS X too:
>
> ---------------------------- Info -----------------------------
> List Post: <mailto:macosx-emacs@email.esm.psu.edu>
> List Archives: <http://dir.gmane.org/gmane.emacs.macintosh.osx>

Thank you, I will post there if I continue to have trouble
on tiger.

>
> --
> Greetings
>
>    Pete
>
> Our enemies are innovative and resourceful, and so are we. They never
> stop thinking about new ways to harm our country and our people, and
> neither do we. -- Georges W. Bush
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-19 11:32           ` Anne G
@ 2005-11-19 12:18             ` Peter Dyballa
  2005-11-19 14:19               ` Anne G
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Dyballa @ 2005-11-19 12:18 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 19.11.2005 um 12:32 schrieb Anne G:

> I was worried that emacs might be using the ruby 1.6 which
> comes as a default on panther, so I deleted two folders that
> had 1.6 in it, and checked terminal still runs my snipet.

There is an "easy" way to correct the system when it constantly uses  
the wrong binary: change the search path, i.e. the PATH variable in  
bash or path in tcsh. To do so invoke in some shell 'which programme  
name', i.e. 'which ruby'. The answer might be /bin/ruby. So you now  
know that /bin should come later in PATH or path. For bash you can  
change in ~/.bashrc (which is always executed when bash is launched)

	export PATH="<home of new ruby>:$PATH"

for tcsh there is .tcshrc:

	set path=(<home of new ruby> $path)

>
> The DLY directory line seems permanently removed.
>

That's what you think! Just try this: M-x shell-command <RET> env |  
sort <RET>! And then look (search) for DYLD_LIBRARY_PATH. It's still  
there, isn't it? The runtime environment, in which Carbon Emacs  
executes, still has this variable set. Any process that is spawned by  
Emacs, for example a compilation, inherits this environment. Try to  
rename (or remove) these two  
/Applications/Emacs.app/Contents/Resources/share/emacs/22.0.50/site- 
lisp/site-start.d/carbon-emacs-builtin-aspell.el* files! In Carbon  
Emacs it's very easy to access the interiors of an application bundle.

To check whether things are right in Carbon Emacs' runtime environment  
you can use this: M-! env | egrep -w 'PATH|DYLD_LIBRARY_PATH' (the  
short version).

For those graphical Mac OS X applications there is (almost?) no other  
way then ~/.MacOSX/environment.plist to prepare them with a suitable  
runtime environment. Once you have created that file (in the Developer  
Tools there is a Property List Editor which is automagically launched  
when you invoke in a shell 'open ~/.MacOSX/environment.plist'), it  
probably works at once when you invoke an application newly. And it  
changes the runtime environments for all applications too, once they've  
been re-launched!

Read Apple's http://developer.apple.com/qa/qa2001/qa1067.html!

--
Greetings

   Pete

Mac OS X is like a wigwam: no fences, no gates, but an apache inside.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-19 12:18             ` Peter Dyballa
@ 2005-11-19 14:19               ` Anne G
  2005-11-19 15:03                 ` Peter Dyballa
  0 siblings, 1 reply; 15+ messages in thread
From: Anne G @ 2005-11-19 14:19 UTC (permalink / raw)
  Cc: help-gnu-emacs

Thank you for the information on controlling which version
gets run. It will come in handy when I have to upgrade from
the tiger version.

> > The DLY directory line seems permanently removed.
>
> That's what you think! Just try this: M-x shell-command <RET> env |
> sort <RET>! And then look (search) for DYLD_LIBRARY_PATH. It's still
> there, isn't it?
Yes indeed. You are right. I had not followed up on your
instructions to remove the file.

The runtime environment, in which Carbon Emacs
> executes, still has this variable set. Any process that is spawned by
> Emacs, for example a compilation, inherits this environment. Try to
> rename (or remove) these two
> /Applications/Emacs.app/Contents/Resources/share/emacs/22.0.50/site-
> lisp/site-start.d/carbon-emacs-builtin-aspell.el* files! In Carbon
> Emacs it's very easy to access the interiors of an application bundle.
>
I did not have the .elc file
AnnePB:/applications/Emacs.app/Contents/Resources/share/emacs/22.0.50/site-lisp/site-start.d
anne$ ls -l
total 24
-rw-r--r--  1 anne  admin   645 28 Sep 10:02
carbon-emacs-builtin.aspell.le
-rw-r--r--  1 anne  admin  1116 18 Jul 17:02
carbon-emacs-japanese-init.el
-rw-r--r--  1 anne  admin   259 25 Sep 11:18
carbon-emacs-path.el

I renamed the aspell file .le instead of .el

redoing the above in emacs, there is no line with DYLD
EMACSDATA=/Applications/Emacs.app/Contents/Resources/etc
EMACSDOC=/Applications/Emacs.app/Contents/Resources/etc
EMACSLOADPATH=/Applications/Emacs.app/Contents/Resources/lisp:/Applications/Emacs.app/Contents/Resources/leim:/Applications/Emacs.app/Contents/Resources/site-lisp
EMACSPATH=/Applications/Emacs.app/Contents/MacOS/libexec:/Applications/Emacs.app/Contents/MacOS/bin
HOME=/Users/anne
INFOPATH=/Applications/Emacs.app/Contents/Resources/info
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/Users/anne:/usr/local/bin:/usr/X11R6/bin
PWD=/Users/anne/Desktop
SHELL=/bin/bash
SHLVL=1
USER=anne
_=/usr/bin/env
__CF_USER_TEXT_ENCODING=0x1F6:0:0

The terminal shell still works, emacs does not. Same error.

> For those graphical Mac OS X applications there is (almost?) no other
> way then ~/.MacOSX/environment.plist to prepare them with a suitable
> runtime environment.
the site says, I would need to create a directory and a
.plist file, as I have neither one.

I looked in my panther book at all the bash environment
variables, but I have no clue as to what to do.  Sorry.

Thanks for all your effort.

Anne

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-19 14:19               ` Anne G
@ 2005-11-19 15:03                 ` Peter Dyballa
  0 siblings, 0 replies; 15+ messages in thread
From: Peter Dyballa @ 2005-11-19 15:03 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 19.11.2005 um 15:19 schrieb Anne G:

> PATH=/usr/bin:/bin:/usr/sbin:/sbin:/Users/anne:/usr/local/bin:/usr/ 
> X11R6/bin
> PWD=/Users/anne/Desktop
> SHELL=/bin/bash
> SHLVL=1
> USER=anne
> _=/usr/bin/env
> __CF_USER_TEXT_ENCODING=0x1F6:0:0
>
> The terminal shell still works, emacs does not. Same error.

Yes, because PATH still starts with /usr/bin:/bin, so Apple's ruby in  
/usr/bin is found first. If in Terminal the right ruby is found, you  
can type there `which ruby` and you have the PATH element (all before  
/ruby) that needs to be prepended to /usr/bin:/bin:... in the form  
'<PATH element>:'.

>
>> For those graphical Mac OS X applications there is (almost?) no other
>> way then ~/.MacOSX/environment.plist to prepare them with a suitable
>> runtime environment.
> the site says, I would need to create a directory and a
> .plist file, as I have neither one.
>

To create the empty directory: mkdir ~/.MacOSX

Then in Emacs open in that directory (C-x d, position the cursor, f)  
the file (C-x f) environment.plist and insert this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"  
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
         <key>PATH</key>
          
<string>/Users/pete/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/ 
usr/local/bin:/sw/bin:/usr/local/teTeX/bin/powerpc-apple-darwin- 
current</string>
</dict>
</plist>

The text between    <string> and </string>   is the PATH. What you see  
is mine, including a place where I have some shell scripts, including  
places where X11 applications or other programmes from the public  
domain can be found. So they are accessible from inside any Mac OS X  
application. (You know how to save a file in Emacs? C-x C-s)


In case you are searching in Emacs for the files that set the bash  
environment, type in Emacs 'C-x d ~ <RET>'. You will see in the  
mini-buffer the text '/Users/anne/Desktop/', which is your current  
working directory. Appending '~' to it makes Emacs to open your HOME  
directory when you press the return key. And there you see the other  
side of Mac OS X ... file names starting with '.', colourful  
directories (folders) ... Is it this what you addressed by writing:

> I looked in my panther book at all the bash environment
> variables, but I have no clue as to what to do.  Sorry.


--
Greetings

   Pete

Without vi there is only GNU Emacs

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
@ 2005-11-19 17:19 Anne G
  0 siblings, 0 replies; 15+ messages in thread
From: Anne G @ 2005-11-19 17:19 UTC (permalink / raw)


> > PATH=/usr/bin:/bin:/usr/sbin:/sbin:/Users/anne:/usr/local/bin:/usr/
> > X11R6/bin
>
> Yes, because PATH still starts with /usr/bin:/bin, so Apple's ruby in
> /usr/bin is found first.
I did not think it mattered since I had taken out the two
ruby 1.6 directories.

I practiced your command on the terminal
echo $PATH
/usr/local/bin:/usr/local/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin
as you can see, it works and reworks.

in the emacs shell command
echo $SHELL
does give me /bin/bash
but the command export
usr/bin:/bin:/usr/sbin:/sbin:/Users/anne:/usr/local/bin:/usr/X11R6/bin

has no effect.
The beginning is set in etc/profile, but I don't know how to
overide the write protect.

> To create the empty directory: mkdir ~/.MacOSX
>
> Then in Emacs open in that directory (C-x d, position the cursor, f)
> the file (C-x f) environment.plist and insert this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST
1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
         <key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin</string>
</dict>
</plist>


(I removed the paths which I could not find on my computer)

I rebooted the computer, and echo $PATH echoed what I have
just put into environment.plist.

I tried compiling my snipet from emacs, and this time, it
compiled!!!!!!!!!!!!!! I don't know if anything else will be
having trouble finding a path. But this demonstrate for sure
that the problem is the path.

> > I looked in my panther book at all the bash environment
> > variables, but I have no clue as to what to do.  Sorry.

Looking at the dev site, I had no clue this text above in
environment.plist was the code to put in.

I am a little lost. Do I need to report a bug? If so what
information do I need to give as to the fix? The one about
changing the path with environment.plist?

Thank you for getting me through with this

Anne

^ permalink raw reply	[flat|nested] 15+ messages in thread

* can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-19 19:20 Success, emacs compiled my snipet Peter Dyballa
@ 2005-11-20  0:16 ` Anne G
  2005-11-20  1:13   ` Peter Dyballa
  0 siblings, 1 reply; 15+ messages in thread
From: Anne G @ 2005-11-20  0:16 UTC (permalink / raw)
  Cc: help-gnu-emacs

What is the story, one step too many and you fall back into
the infierno, orpheus or some such?

Turning the le into el and rebooting, emacs now gives me a
permission denied on line 1, which is the require 'tk' line.
turning the .el back to .le did not get it to work again.
There is no Dyld that I can see.

EMACSDATA=/Applications/Emacs.app/Contents/Resources/etc
EMACSDOC=/Applications/Emacs.app/Contents/Resources/etc
EMACSLOADPATH=/Applications/Emacs.app/Contents/Resources/lisp:/Applications/Emacs.app/Contents/Resources/leim:/Applications/Emacs.app/Contents/Resources/site-lisp
EMACSPATH=/Applications/Emacs.app/Contents/MacOS/libexec:/Applications/Emacs.app/Contents/MacOS/bin
HOME=/Users/anne
INFOPATH=/Applications/Emacs.app/Contents/Resources/info
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin
PWD=/Users/anne/Desktop
SECURITYSESSIONID=211460
SHELL=/bin/bash
SHLVL=1
USER=anne
_=/usr/bin/env
__CF_USER_TEXT_ENCODING=0x1F6:0:0

Oh well, terminal still works fine. And well, I have learned
something about the complexity of setting things up to work
together!

~/.bashrc has
# add /usr/local/bin to the path
export PATH=/usr/local/bin:$PATH

this does not have your " quote" but adding the " does not
resolve this new permission denied mesage. This is how it
was when it worked.

I had not added anything in this file about Dyld apparently.
Just entered the command at the prompt.

I did not touch the ~/MacOSX/environment.plist
 version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST
1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
         <key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin</string>
</dict>
</plist>

Litteraly, the only things I changed knowingly was adding
the " " in ~/.bashrc and removing them, and changing file
from .le to .el and back to
carbon-emacs-builtin.aspell.le
carbon-emacs-japanese-init.el   carbon-emacs-path.el

Strange. Bummer

anne

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-20  0:16 ` can one run tk/Ruby gui code from an emacs shell with compile? Anne G
@ 2005-11-20  1:13   ` Peter Dyballa
  2005-11-20 14:41     ` Anne G
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Dyballa @ 2005-11-20  1:13 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 20.11.2005 um 01:16 schrieb Anne G:

> Turning the le into el and rebooting, emacs now gives me a
> permission denied on line 1,
> Just entered the command at the prompt.

And the command was .bashrc?

That's not needed! bash reads that file automatically when it launches. 
It's like Emacs reads .emacs (and other files, for example .emacs_bash 
when you create the shell buffer in Emacs). So the 'permission denied' 
message tells you that .bashrc can't be executed, which is normal, 
since you usually do not create files in Emacs (or by vi) that are 
executable from the start. You would have to make them executable (with 
chmod; did you already try in Emacs M-x manual-entry <RET>? At the 
prompt you can type chmod and give it a <RET>.)

> turning the .el back to .le did not get it to work again.
> There is no Dyld that I can see.
>

Because you cut away lines starting with A, B, C, D ... Try exactly 
this with the single quotes to see in *Shell Command Output* maximally 
two lines:

	M-! env | egrep -w 'PATH|DYLD_LIBRARY_PATH'

M-! inveokes Emacs' shell-command function. Then env (list the shell's 
environment) is excuted. Its output is filtered with egrep, which is 
told to look up whole words (-w). The words are described in the 
regular expression following. This has a vertical bar (|) which has a 
special meaning in a shell, so it has to be escaped by putting it into 
single quotes.


> Turning the le into el and rebooting,

Anne, you don't need to reboot your Mac when you change an Elisp (Emacs 
Lisp) file's name. Just re-launch that application.


It's here already after midnight. It's Sunday. And I'm going to bed. I 
won't have much time before local noon and I'll be out of house for 
some hours in the afternoon. I think there is no real error, you just 
made a mistake in shell. Earlier I forgot one file to mention: 
~/.emacs_bash! That's the one with the unset command. If you try to 
find out whether /usr/local/bin/ruby works correctly with 
DYLD_LIBRARY_PATH then you should comment that unset statement. This 
comment *will* raise another error, but don't get confused of this, 
it's normal interaction of Emacs and bash. Nothing fails there, it's 
just that the unset command can't be executed, so shell will have 
DYLD_LIBRARY_PATH set.

--
Greetings

   Pete

A lot of us are working harder than we want, at things we don't like to
do.  Why? ...In order to afford the sort of existence we don't care to 
live.
	-- Bradford Angier

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-20  1:13   ` Peter Dyballa
@ 2005-11-20 14:41     ` Anne G
  2005-11-20 15:53       ` Peter Dyballa
  0 siblings, 1 reply; 15+ messages in thread
From: Anne G @ 2005-11-20 14:41 UTC (permalink / raw)
  Cc: help-gnu-emacs

Yes, I was getting tired. I must have done compile
myfilename instead of compile ruby myfilename. That's
probably why I got the permission denied. And something
replaced request with Request in emacs, and Request does not
work.

In any case, I got terminal and emacs to work again.

I commented with # the line in /.emacs_bash and moved the
file from le to el and rebooted.
terminal and emacs still work.

env | egrep -w 'PATH|DYLD_LIBRARY_PATH'
in the emacs shell:
PATH=/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin
DYLD_LIBRARY_PATH=/Applications/Emacs.app/Contents/Resources/lib

with cat ~/.emacs_bash
	# unset DYLD_LIBRARY_PATH
and cat ~/.bashrc
	# Add /usr/local/bin to the path
	export PATH=/usr/local/bin:$PATH
and
~/.MacOSX/environment.plist
	<?xml version="1.0" encoding="UTF-8"?>
	<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST
	1.0//EN"
	"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
	<plist version="1.0">
	<dict>
        	 <key>PATH</key>
	<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin</string>
	</dict>
	</plist

with the environment.plist in the trash, the path is
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/anne:/usr/local/bin:/usr/X11R6/bin
DYLD_LIBRARY_PATH=/Applications/Emacs.app/Contents/Resources/lib

and the compilation gives an error
ruby ~/Desktop/dudruby3.rb
/Users/anne/Desktop/dudruby3.rb:1:in `require': No such file
to load -- tk (LoadError)
	from /Users/anne/Desktop/dudruby3.rb:1
So the environment.plist is needed.

so the environment.plist is important.

rubycocoa stopped working even with a tutorial which used to
work fine, even with reinstall from package. even with
environement.plist out in trash. Oh well.  Don't know when
it stopped working exactly. Something to watch out for
another time.

I hope this additional testing helps figure out the problem.

Sorry to have taken so much of your time.

anne

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: can one run tk/Ruby gui code from an emacs shell with compile?
  2005-11-20 14:41     ` Anne G
@ 2005-11-20 15:53       ` Peter Dyballa
  0 siblings, 0 replies; 15+ messages in thread
From: Peter Dyballa @ 2005-11-20 15:53 UTC (permalink / raw)
  Cc: Emacs help


Am 20.11.2005 um 15:41 schrieb Anne G:

>
> I commented with # the line in /.emacs_bash and moved the
> file from le to el and rebooted.
> terminal and emacs still work.

Anne, as I mentioned earlier: there is no reboot necessary (accept you  
install a new software or an update and the installer tells you to do  
so). If you make changes to dot-files (like ~/.bashrc) it's sufficient  
to log off and in again. Mac OS X is not MS Windows.

>
> env | egrep -w 'PATH|DYLD_LIBRARY_PATH'
> in the emacs shell:
> PATH=/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ 
> X11R6/bin
> DYLD_LIBRARY_PATH=/Applications/Emacs.app/Contents/Resources/lib
>

This all shows that DYLD_LIBRARY_PATH isn't that relevant as I thought  
first -- and I could have asked earlier for the path names of the two  
rubies. But this seemed to be too trivial ...

It makes no sense to report a bug when there is none, when it was just  
a problem with PATH.

> So the environment.plist is needed.
>
> so the environment.plist is important.
>

Let's say: it's sometimes useful. Anne, you should understand that in  
Emacs you have two kinds of environment. There is first the environment  
in which the Emacs process itself runs. This one is affected by  
settings in ~/.MacOSX/environment.plist. In case you do in Emacs 'M-x  
compile <RET> then this make process in its own buffer inherits its  
environment from Emacs. If you type in Emacs' *shell* buffer 'compile  
ruby filename' then the compile command inherits its environment from  
the shell, which in your case is bash. Bash inherits of course too from  
Emacs first, but then there is /etc/profile or ~/.bashrc which apply  
changes to bash's environment. And finally comes Emacs itself because  
of ~/.emacs_bash.

So 'env | egrep -w 'PATH|DYLD_LIBRARY_PATH'' in shell and 'M-! env |  
egrep -w 'PATH|DYLD_LIBRARY_PATH'' in Emacs can deliver different  
output.

(Think of water coming out of a pipe or tap. The provider sets some  
standards so that every time you open the tap it's the same. Into one  
probe you can pour some aroma or syrup, so you have a bit more in it.  
Another portion of water yoo can pour into a 'filter' that removes lime  
for a tastier tea. So you have less in that probe. And again you can  
take probes from these first ones and again you can apply changes to  
them, add or delete something.)

Against tiredness in shell there are a few means: history, command and  
file name completion. Emacs' *shell* buffer has its own history of  
commands. You can browse them with M-up, or search for one with M-r and  
a regular expression.

>
> Sorry to have taken so much of your time.
>

Wasn't so bad. I had to wait for some lengthy compilations to finish.  
And it helps trying to imagine what happens to others.

--
Greetings

   Pete

"I love deadlines. I love the whooshing noise they make as they go by"  
(Douglas Adams)

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2005-11-20 15:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-19 17:19 can one run tk/Ruby gui code from an emacs shell with compile? Anne G
  -- strict thread matches above, loose matches on Subject: below --
2005-11-19 19:20 Success, emacs compiled my snipet Peter Dyballa
2005-11-20  0:16 ` can one run tk/Ruby gui code from an emacs shell with compile? Anne G
2005-11-20  1:13   ` Peter Dyballa
2005-11-20 14:41     ` Anne G
2005-11-20 15:53       ` Peter Dyballa
2005-11-18 17:11 anne001
2005-11-18 18:18 ` Peter Dyballa
2005-11-18 18:51   ` Anne G
2005-11-18 19:53     ` Peter Dyballa
2005-11-19  0:56       ` Anne G
2005-11-19  9:48         ` Peter Dyballa
2005-11-19 11:32           ` Anne G
2005-11-19 12:18             ` Peter Dyballa
2005-11-19 14:19               ` Anne G
2005-11-19 15:03                 ` Peter Dyballa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).