Try upgrading your installation of RVM if you are running something older than 1.6.10 (check your active version with rvm --version
).
In some shell:
rvm get latest
Then, either restart your other, existing shells, or run rvm reload
in them.
Note: Another problem the OP faced was PATH manipulation after RVM was loaded into the shell. This created the “right gemset selected, but wrong installation of ruby” effect that disappeared after “cd out, cd in” (since RVM would have reasserted its position in the PATH at that point). When a shell is started in a directory that contains an .rvmrc
it is vital that RVM be the last thing to prepend elements to the PATH (at least any PATH elements that might contain a ruby
(etc.) so that the Ruby installation selected in the .rvmrc
will be effective).
RVM arranges to source .rvmrc
files by “hooking” your shell’s cd
command (a cd
shell function in bash, an entry in chpwd_functions
for zsh). Normally this lets it catch any “normal” cd
command that you type it or run via a sourced script after loading RVM.
I do not have Lion to test with, but I suspect the way it works is that Terminal forks, calls chdir(2), then execs your shell to establish your new shell’s initial working directory. This means that the directory is already established by the time RVM is loaded in your shell initialization file.
The history seems a bit muddy, but RVM has had some support for sourcing the .rvmrc
file in the shell’s initial working directory when it is first loaded. It looks like maybe it was intended to be screen-specific, but in RVM commit cb649ba (Always load the .rvmrc if in an interactive shell (open new tab in same dir)., 2011-05-14) relaxed the requirement so that it should source .rvmrc
files for any interactive shell when RVM is first loaded. This commit was first present in the 1.6.10 release of RVM. The code has changed a bit since then, but it still works in (more or less) the same way in the latest versions.
See above - the PG gem was the culprit. Apparently, it automatically compiles against the OS X built-in Postgres (9.0) libraries, which are of course compiled against OS X builtin OpenSSL.
Once I found this to be the reason, the fix was trivial. No need to install RVM, rbenv, Homebrew or anything else. Just recompile the PG gem ...
Best Answer
You could only save as .rtf because the file was rich text. To make it plain text, simply press ⇧ shift-⌘ command-T or go Format > Make Plain Text, then you can save as .rb.
Try not to use TextEdit: there is no syntax highlighting and code completion, not to mention that you have to manually turn off those wrong quotation marks.