Textmate error running commands after Yosemite upgrade - ruby

I recently upgraded my Mac to Yosemite, and now many Textmate 2 commands that I used to use all the time are failing and giving the following error—in this example I tried to run the "Comment line" command by pressing ⌘/:
The same thing happens for "Run", "Toggle String / Symbol", and many other Textmate commands.
When I click "Edit Command", it takes me to a script the first line of which is:
#!/usr/bin/env ruby18
If I take the 18 off of that, it seems to work, but I would have to do it for every command. There must be a better way.
I use rbenv and long ago I set my TM_RUBY variable to $HOME/.rbenv/shims/ruby, but setting or unsetting that doesn't seem to make a difference now. I also tried adding that path to TM's PATH variable. Any other ideas?

I figured out an answer. Running ruby18 at the command line produced a "command not found" error. So I created a symlink to the system ruby (which is ruby 2.0) with that name:
ln -s /usr/bin/ruby /usr/local/bin/ruby18
That seems to have worked. Still not sure if that's the best solution. Open to any other ideas.

Related

-bash: ghci: command not found (Haskell interactive shell, Haskell installation )

edit : I ended up upgrading to macOS Catalina yesterday and replacing bash with zsh. One thing that should be noted is that the stackcommand worked previously, but despite all the tinkering not ghci
After deleting all the files that had anything to do with Haskell, I retried running curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
This second time there was an error with the command line tools so I had to install them manually with xcode-select --install. After rerunning the curl, I added the path to the environmental file to my zsh profile manually with :
. "$HOME/.ghcup/env"\
echo '. $HOME/.ghcup/env' >> "$HOME/.zshrc"
Here is the content of the env file :export PATH="$HOME/.cabal/bin:/Users/agnel/.ghcup/bin:$PATH"
Now everything seems to be working (I never reinstalled stack, but I think I might leave that to the side while I learn the basics of the language).
I installed the Haskell Platform yesterday but am having a hard time getting it to work correctly.
The firsts steps I did are:
curl -sSL https://get.haskellstack.org/ | sh
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
On step 1. the instructions said to append /Users/.../.local/bin the PATH variable (which I did in /etc/paths. On step 2, the script was supposed to pop up a dialog box (and didn't) when installing the necessary command line tools. It also said to rerun the script once complete (which I did). The script also said I should adjust my PATH variable, and source /Users/.../.ghcup/env in my shell configuration. It asked to this automatically but failed having not found the ~/.bashrc File. (I read that on Mac in contrary to linux, only .bash_profile is loaded upon opening of a terminal window so I adjusted the path variable there manually. I've spent forever messing around with the path variables and every time I try and run "$ ghci" I get the same -bash: ghci: command not found error message. If anyone has a solution to this problem I would be very grateful for an answer. If not, could someone with a working distribution of Haskell on their computer show me what their path variables look like?
Thanks!
A simple solution would just be to restart your terminal and you are good to go.
After installing the Haskell platform for the first time on a new mac with Catalina, I also got
~> ghci
zsh: command not found: ghci
What worked in my case was to use, instead of the plain ghci,
stack ghci
To get back the familiar behaviour, I created in my homedirectory a file named .zshrc containing
alias ghci='stack ghci'
If you open a new terminal, this file will automatically be executed.
I'd be interested to know if there is another solution.
Check if the ghcup command is working or not.
If not, make sure the .zshrc file has command for execution of ghcup. It should look something like this -
[ -f "/Users/myusername/.ghcup/env" ] && source "/Users/myusername/.ghcup/env" # ghcup-env
If the file exists, simply restarting terminal will work.
If it is still not working, set GHC as default using ghcup - follow this

Zshell starting with an error (showed in Powerline9k-theme)

Recently I installed Zshell instead of Bash. During this, then I saw that my $PATH was 7 miles long, - so I decided to try and clean it up a bit. When I uninstalled rvm (by running rvm implode followed by rm -rf ~/.rvm) then when I restarted my terminal, I now see an error:
If I just press ENTER, then the error remains. But if I do any other command, then it disappears (ls, echo, source ~/.zshrc - you name it).
If I reboot iTerm (or start a new tab), - then the error re-appears.
The error is not being showed, - so if I activate another theme, then I can't see if there is an error.
My gut feeling tells me, that it has something to do with my path, but I'm not sure. My path is waaay shorter than before RVM was installed.
If i rename my ~/.zshrc-file, then the Powerline9k-theme gets deactivated, so I can't see if the error actually still appears or not. But I have tried it... Then a theme-less zshell just start up.
Any idea how to fix it or how to debug it?
EDIT
I just realized that it could actually have been a left-over-error, from back when I was running bash, - so I added that tag as well.
If the visual blemish disappears as soon as you execute any command as you say so, just place an echo -n at the end of your .zshrc as a quick and easy fix, if you are not up to the task of debugging and potentially causing more problems on your machine.
The issue isn't worth your time ;)
Edit: Apparently the above didn't work. See comments.
If you are interested in debugging, a good starting point would be to place set -xe (print every line that is executing and abort on any line that exits nonzero) at the beginning (after the shebang line, or as flags in the shebang) of each configuration script that is executed when you start a new interactive shell.
Also consider set -xeuo pipefail to additionally catch and abort on usage of unset shell variables and commands that return nonzero inside pipes (e.g. set -e will not abort on false | true because the overall line exited with status 0, but -o pipefail will abort on such a line). It is worth noting that these flags are bash features, but since zsh is a feature superset of bash, they work in zsh too.
Have look at their documentation on github, relevant fragment is here.
Solution:
In your ~/.zshrc find variable called POWERLEVEL9K_LEFT_PROMPT_ELEMENTS and remove rbenv.
Explanation:
The default value of POWERLEVEL9K_LEFT_PROMPT_ELEMENTS is (context dir rbenv vcs), and it is likely that rbenv is the segment producing the error - after you uninstalled rvm that segment can't execute.
Uninstall all apps that use the path and reinstall. It's the only way. Instead of rm, you use should create an alias that has a trash can.

Terminal in OSX Lion looks different after unknown command

I spent some time today installing Ruby, Rails and other web development stuff through homebrew and rvm. But somewhere i must have put the wrong command in the terminal since my terminal on OS X Lion (same with both standard terminal and iTerm2) now looks weird.
How do I get rid of that red tilde and black arrow and get it back how it looks as default?
As I am a beginner at terminal commands I would appreciate your help.
it seems like PS1 has been changed.
what you can do now is to change it back, or simply delete it to return to default.
in terminal, do the following:
cd ~
grep "export PS1" .*
then you will see some outputs, it might be in .profile or .bashrc, (just ignore the history one)
you can use whatever to open the file. or just open .filename in terminal, delete the line with export PS1, save, relogin. the problem shall be resolved.

RVM not being found (Mac 10.7.3)

I've done a lot of searching and there seem to be similar issues, but none that have helped me solve this problem. I'm fairly new to Ruby, Rails, and -ix systems so that doesn't help much, either. :(
I was able to get RVM up and running along with the latest versions (1.9.3-p125 of Ruby and 3.2 of Rails). However, when I exit terminal and come back in the system defaults are being used. When I tried to change versions I received a "command not found". I then tried just typing "rvm" and got:
-bash: rvm: command not found
I followed some other tutorial advice and modified my ~/.bashrc file to look like this:
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
but I'm still getting the exact same "command not found" even after exiting Terminal.
Any thoughts on how to get RVM working properly? Everyone says use it, but it sure isn't simple...
Thanks a lot!
Greg
I followed some other tutorial advice and modified my ~/.bashrc file
Usually I modify .profile file on Mac OS X, and .bashrc on Linux. Try to modify .profile
Please check How to fix Terminal not loading ~/.bashrc on OS X Lion to know why Terminal doesn't load .bashrc file.
If you modify your .bashrc you either need to immediately source it or create a new shell to see the changes take effect.
The standard rvm procedure is to source the rvm script that is created. The installation documentation covers most use cases.
If your rvm command is missing, it's possible that your .bashrc is not working as you expect. Is your PATH being modified as you've requested? If not you might have another issue.

rvm-installed ruby: runs in terminal fine, not anywhere else

I have installed Ruby via RVM on Linux Mint 11. It seems to have installed fine: when I enter type rvm | head -1, I get "rvm is a function" back. Entering ruby -v gives me 1.9.2p290. I can run ruby scripts from the bash terminal window fine. However, when I try to run the same scripts from say gvim (I've got a shortcut mapped to "ruby ") or geany or gedit (ditto), I get "ruby: command not found" (in gvim) or "ruby: not found" (in geany or gedit).
Here's more information: "which ruby" gives me: $HOME/.rvm/rubies/ruby-1.9.2-p290/bin/ruby. $HOME/.rvm/rubies/ruby-1.9.2-p290/bin is in my path in my .bashrc. On another Linux Mint 11 machine, where all works fine, "which ruby" gives me $HOME/.rvm/bin/ruby. Also, on the machine where all is fine, I have a $HOME/bin folder that I don't know where it came from, but was created the same day as my .rvm folder. It contains among other things, links to shell scripts in the $HOME/.rvm/wrappers folder.
I had same problem, you should try making shell login. To make so use the command "bash -l" instead of simply "bash". In geany you can find where to change it in edit->preferences->terminal->shell
I think you dont have your current ruby set as system default. try running this command:
rvm use 1.9.2 --default

Resources