I need help getting Textmate to find gems. I've spent quite a bit of type
researching the problem, but being new to both OS X (Snow Leopard) and the
use of Ruby gems, I can't seem to figure out what the problems are. Many
others have had similar problems, but their solutions don't seem to fix my
problems. (Among other things, I did read Section 8--Shell Commands--of the
Textmate manual.) I expect it largely has to do with the setting of
environmental variables, but that's just a guess. A secondary--and no doubt
related--problem is that Ruby cannot find the gem active-record when invoked
in a terminal (or in irb), as shown below.
I've tried entering a TM_PATH shell variable in Textmate preferences, but
that hasn't helped.
Here are some possible clues. No doubt I have provided some unnecessary
information and have left out important information.
I recently used RVM (Ruby Version Manager) to reinstall Ruby. From a
terminal I then ran
gem install xml-simple
gem install sqlite3
gem install activerecord
They all appeared to install OK.
Then I wrote the following short script (test.rb):
************
#!/usr/local/bin/ruby
# Ruby 1.9.2
require 'rubygems'
print 'Gem.path = '
puts Gem.path
print 'ruby_description = '
puts RUBY_DESCRIPTION
require 'xmlsimple'
require 'sqlite3'
require 'active-record'
*************
When I run test.rb in a terminal I get:
*************
MacBook-Pro-2:economics101 cary$ ruby test.rb
Gem.path = /Users/cary/.rvm/gems/ruby-1.9.2-p0
/Users/cary/.rvm/gems/ruby-1.9.2-p0@global
ruby_description = ruby 1.9.2p0 (2010-08-18 revision 29036)
[x86_64-darwin10.4.0]
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load
-- activerecord (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from test.rb:12:in `<main>'
*************
When I run Ruby test.rb from within Textmate (cntrl-r), I get:
*************
Gem.path =
/Users/cary/.rvm/gems/ruby-1.9.2-p0@global
/usr/local/lib/ruby/gems/1.9.1
ruby_description = ruby 1.9.2dev (2010-07-02 revision 28524)
[x86_64-darwin10.4.0]
LoadError: no such file to load — sqlite3
method require in test.rb at line 11
method <main> in test.rb at line 11
copy output
*************
(If I have <require 'active-record'> before <require 'sqlite3'>, I get the
same message, with 'active-record' substituted for 'sqlite3'.)
Notice that xmlsimple was found when running test.rb from a terminal, but
not with cntrl-r in Textmate. See below (near the end) where I think
Textmate found xmlsimple.
Next I ran irb:
*************
MacBook-Pro-2:~ cary$ irb
/Users/cary/.rvm/rubies/ruby-1.9.2-p0/bin/irb:4: warning: Insecure world
writable dir /Users/cary in PATH, mode 040777
ruby-1.9.2-p0 > RUBY_DESCRIPTION
=> "ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]"
ruby-1.9.2-p0 > Gem.path
=> ["/Users/cary/.rvm/gems/ruby-1.9.2-p0",
"/Users/cary/.rvm/gems/ruby-1.9.2-p0@global"]
ruby-1.9.2-p0 > require 'xmlsimple'
=> true
ruby-1.9.2-p0 > require 'sqlite3'
=> true
ruby-1.9.2-p0 > require 'active-record'
LoadError: no such file to load -- active-record
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from (irb):1
from /Users/cary/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
(ibr's message, "warning: Insecure world writable dir /Users/cary in PATH,
mode 040777" is something I should look into as well.)
*************
(It makes no difference if I precede the above with <'require rubygems'>.)
and then back at a terminal:
*************
MacBook-Pro-2:~ cary$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
MacBook-Pro-2:~ cary$ which ruby
/Users/cary/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
MacBook-Pro-2:~ cary$ echo $PATH
/Users/cary/.rvm/gems/ruby-1.9.2-p0/bin:
/Users/cary/.rvm/gems/ruby-1.9.2-p0@global/bin:
/Users/cary/.rvm/rubies/ruby-1.9.2-p0/bin:
/Users/cary/.rvm/bin:/usr/local/bin:
/usr/local/sbin:
/usr/local/mysql/bin:
/usr/bin:/bin:
/usr/sbin:
/sbin:
/usr/local/bin:
/usr/X11/bin
MacBook-Pro-2:~ cary$ ls /Users/cary/.rvm/gems/ruby-1.9.2-p0
bin cache doc gems specifications
MacBook-Pro-2:~ cary$ ls /Users/cary/.rvm/gems/ruby-1.9.2-p0/gems
activerecord-3.0.0 arel-1.0.1 ffi-0.6.3 rake-0.8.7 tzinfo-0.3.23
activesupport-3.0.0 builder-2.1.2 i18n-0.4.1 sqlite3-0.1.1
xml-simple-1.0.12
MacBook-Pro-2:economics101 cary$ ls
/Users/cary/.rvm/gems/ruby-1.9.2-p0@global/gems
MacBook-Pro-2:economics101 cary$
MacBook-Pro-2:economics101 cary$ ls /usr/local/lib/ruby/gems/1.9.1/gems
libxml-ruby-1.1.4 xml-simple-1.0.12
*************
The last line suggests to me that, from Textmate, Ruby is using an old
version of xlm-simple.
Any help would be greatly appreciated.
Cary
--
View this message in context: http://old.nabble.com/Textmate-cannot-find-Ruby-gems-tp29724886p29724886.ht…
Sent from the textmate users mailing list archive at Nabble.com.
Dear TextMate users,
I work with textmate 1.5.8 (1505) under Mac OS X 10.6.2. I installed the latest version of latexmk (version 4.11) and tested it in the terminal, works like a charm. I then tried to compile a .tex document with latexmk via TextMate. If I click the button "Show Latexmk.pl Messages" I can see which version of latexmk is used. It turns out that some old version is used (version 3.21j of 2 December 2007). After that I changed the variable "TM_LATEX_COMPILER" explicitly from "latexmk.pl" to "/usr/local/texlive/2009/texmf-dist/scripts/latexmk/latexmk.pl" --- still the old version is used. I have no idea where this old version is located and how I can force TextMate to use the new one. The new one is correctly installed, I can use "latexmk foo.tex" from everywhere on my system.
How can I tell TextMate to use the correct version of latexmk?
Cheers,
Marius
Hi.
I like TextMate and i want to by it.
But i haven't a job now and price for program very expensive for me.
Have you any discount for me?
I respect copiright and anyway not will be to use not license product.
Konstantin. Russia.
Hi all-
I'm writing a command where it would be really great to preserve a string for later use by other commands.
I'm assuming there no way to define a environment variable (like LAST_STAMP or something) that could be set from a command, would persist, and could be read from a later invocation of another command?
Any other kind of scratchpad memory that I could take advantage of? (I realize I could write a small file somewhere.)
Many thanks in advance!
Charles
Hi,
I have a list of functions ( thousands ) for a certain proprietary
language and I would like to enable some sort of autocomplete in
textmate but that works similar to Eclipse's, IDEA's, etc. in that it
allows you to
1. Search or autocomplete
2. Once you select the method, you get a "snippet" template so you can
tab around the parameters
I imagine lots of people have tried this and I am also afraid that
there is no simple solution.
What's the best path here?
FYI. The library consists of around 2000 functions.
Regards,
A
--
Aldo Bucchi
@aldonline
skype:aldo.bucchi
http://aldobucchi.com/
Hi,
I am developing a Bundle that will startup a local database server (
think SQLite ). Some of the questions I have are:
* What's the recommended way of bundling binaries into Bundles, if any?
* What startup/shutdown hooks exist, if any?
Regards,
A
--
Aldo Bucchi
@aldonline
skype:aldo.bucchi
http://aldobucchi.com/
I thought this workflow should work, but it’s running into trouble:
I open a new message in Apple Mail.
I type the keyboard command for Edit in TextMate.
I write a simple document in Markdown.
I use the Markdown bundle command to convert to HTML.
I use the Mail bundle command Send HTML as email via mail.
I get “Syntax Error: Expected end of line but found property (-2741)"
Problem seems to occur whatever the language grammar is set to. I’m using TM version 1.5.9, with updated bundles. I didn’t find a mention of this in the archive.
Thanks very much for any suggestions about a fix or a better workflow.
I'd like to:
1) close all foldings at level 0
2) open all foldings at level 1
casting a single command.
i.e. without having to manually cmd+opt+0 cmd+opt+1
I don't have a clue about how to do it, can somebody help please?
--
venera Lo'oris su http://looris.net
Hello,
thanks for the help, I have tried yoursuggestions and it helps.
But maybe it could be put in the next version as a possible feature, it
would be useful for people writing texts in textmate, especially when
using a screenwriting mode.
Best,
Daniel
Is there a possibility to change the width of the caret so that it would
appear to be a blinking rectangular?
_______________________________________________
Not that I know of, but you might at least try to turn on the "highlight
current line" preference:
go to Preferences
General tab
Check "Visual Ornaments: Highlight current line"
You can then move over to the Fonts & Colors tab and pick a background
color for the current line.
Also, the shortcut Command-L is good for centering the current line
vertically in your window (if it's possible). Between those two, I can
usually find my current line.
I realize that's only one dimension, and you were hoping for two. I
don't know of anything to help you locate the current column, short of
doing something manual, like pressing Shift-RightArrow to make a
selection that would stand out. Not what you were after, but that's the
most hope I can offer.
I betcha, if challenged properly, one of the wunderkinds of this list
like Hans or Ciarán can whip together a plug-in that does just what
you're looking for. But that task is not for me.
+dru