I'm new to development & stack overflow so hopefully my question will be phrased correctly.
Q: How is it that within OS X El Capitan Terminal my Ruby, Rails, & RVM versions are correct, but within iTerm Zsh, it does not reflect the same information. I set up Zsh & honukai theme for aesthetic & practical purposes > standard terminal. How do I set up iTerm2 to reflect the same data. As you can see Ruby is showing an older version besides my best attempt to have it as 2.3.1 (which is set to the default and current within RVM list in iTerm2) and Rails is showing not installed ('rvm not a function' problem within iTerm, but no issue with using rvm as a function within Terminal).
I do want the issue solved, but I also care more about knowing exactly why the problem is occurring in the first place so that I understand the difference between Terminal and iTerm2 Zsh better.
Thanks!
Link to Gyazo image since I do not have 10 reputation to post images.
Comparison Images:
https://gyazo.com/2f4051557e2da6745ff40d2a72e5c568
Zsh rvm list even though ruby -v showing as 2.0.0:
https://gyazo.com/ec2e483adb6287fd409537f4ede59fd2
Related
Greetings fellow problem solvers.
I'll start by saying my level of expertise regarding coding/anything compsci is somewhere right above ZERO (intro to java last semester & currently teaching myself python, but that's it). Also I have a macbook air running 10.14.6(mojave). Ok, here are my questions.
What I did:
I installed macvim version 8.1.2234 before realizing my machine was shipped with vim 8.0.1365 preinstalled. I installed macvim using the download .dmg & "drag/drop to applications" method.
What I'd like to know:
Firstly, MacVim and Vim appear to be separate programs (when I type mvim -v as opposed to vim -v in the terminal, each one shows a different version number as described above). So, how can I remove/replace/update/overwrite or whatever, so that I only have either macvim or vim? I don't really care which one I have as long as I only have one
--> Before telling me to just rename an alias so that one maps to the other, please read the info below <--
I REALLY don't want two nearly identical programs on my computer because, a)it seems like a waste a space b)don't want the possibility of accidentally saving something to the wrong place, or calling something from the wrong place, but mostly c)so I can sleep at night.
That being said, do I NEED both? Does macvim rely on vim to work or do they both exist and work independently? Also does renaming an alias mean that the other will be replaced? Because I would assume that just renaming one would be a lot like having two houses, but making both driveways only go to one house.
Additional info: I have do homebrew but I didn't install macvim using homebrew. I found another post recommending to use (i don't remember exact syntax but something like..) $brew overwrite vim--with-macvim. So I thought great, I'll uninstall macvim since I haven't used it at all yet, and then I'll re-download using the homebrew overwrite method. But then I read that it's a little more complicated than moving the "Vim" folder to the trash, and after two unsuccessful attempts in the terminal that looked like this:
$brew uninstall mvim (throws no keg error)
$brew uninstall macvim (same error)
I decided to reach out for help before I break anything.
Thanks in advance for any info/advice, it is much appreciated!
I don’t have time for a longer explanation at the moment, but:
Breathe Easy
MacVim is nearly completely independent from (terminal) vim. They do share your vimrc, but MacVim also reads gvimrc, and uses its own runtime directories.
You’re not wasting much space, and it would be a Bad Idea™️ to mess with the system installation of some programs.
I'm creating a gem that utilizes SGR codes. There are discrepancies between terminals that I've found myself. E.g. \e[2m makes faint text in Ubuntu's gnome terminal, but \e[2m does nothing in Windows 8.1's Command Prompt With Ruby. So my ruby program needs to know what terminal it is running in and from there, utilize (or not utilize) certain sgr codes.
Is there a magic bullet, in pure ruby or hopefully with a gem, for finding out what terminal we're running in? And I mean any terminal, no matter how exotic. I'd love be able to do this, depending on the terminal we're running my gem in (This is pseudo-code, MagicBullet is a class belonging to the gem I'm hoping you'll refer me to):
MagicBullet.identify #=> ['gnome-terminal', '6.3.2']
Or:
MagicBullet.identify #=> ['konsole', '4.5']
Or:
MagicBullet.identify #=> ['command-prompt', '13.37']
Or:
MagicBullet.identify #=> ['NeWT', '15.2']
Is there a a sure-fire way to find out regardless of OS...this information feels so readily available...maybe a gem that looks for a range of OS signals/processes that belong to a list of known terminals, something like that. I've tried ENV['TERM'], and while that returns :xterm in a gnome-terminal, I'd prefer it to return :gnome-terminal. In Command Prompt With Ruby it returns nil, which isn't very helpful considering all non-linux (I think) terminals will return nil. Of course, I could run if !ENV['TERM'] and then utilize a different set of logic to find the terminal's name, but that doesn't feel "sure fire" to me. It'll probably fail with other "exotic" terminals.
So I'd like, as an answer, either:
A gem that gives a sure-fire way to identify what terminal and what version we're running
A pure ruby way to give a sure-fire way to identify what terminal and what version we're running
An algorithm that gives me a pretty good shot at identifying what terminal and version we're running, and I'm talking all flavors of Linux, Sun Microsystems stuff, Apple's operating systems (Terminal and the third-party iTerm are two terminals for Apple's operating systems for example). Anything that MRI can be installed on.
There is a lot of information on Stack Overflow about how to set environment variables (like this question and this one). Unfortunately it seems that Apple has been playing with this process a lot over the last few years and so much of the discussion online seems to have been rendered obsolete by Mountain Lion and Mavericks. There are two methods discussed in more recent posts: editing launchd.conf and modifying ~/.MacOSX/environment.plist. I've tried both and am still not getting my new environment variable everywhere I want.
I've boiled the problem down to this bit of AppleScript:
set pp to system attribute "PYTHONPATH"
display dialog pp buttons {"OK"} default button 1
When I run the code from the AppleScript editor it gives me a non-empty PYTHONPATH, which is what I want (I'm trying to set the PYTHONPATH variable for scripts run from places other than terminal windows). But when I run the same script from Quicksilver (which is really where I'd like it to work), it gives me an empty Python path. Can I set PYTHONPATH in a way that will show up both places?
The answer was to edit launchd.conf and then restart. This answer claims to tell you how to do it without a restart, but it didn't work for me.
The answer is different under Yosemite. See these two pages:
https://apple.stackexchange.com/a/106814/60655
Setting environment variables via launchd.conf no longer works in OS X Yosemite/El Capitan/macOS Sierra?
For some reasons I had to uninstall/reinstall homebrew on my MacBook Pro (OS X 10.9).
I wanted to reinstall swi-prolog via homebrew (like I did the first time). The installation process worked without any visible issue, but now every time in want to run swi-prolog in my terminal this message appears: "Abort trap: 6"
I have no clue of what that means. There is a lot of things about this message on the internet but I can't relate them with my issue.
Could you help me?
For some reason it seems that the symbolic link doesn't work correctly. In my version of swi-prolog I had to type the full path to get it to run correctly, for example:
/usr/local/Cellar/swi-prolog/6.4.1/bin/swipl
Remember to keep in mind that your version number could be different than what I have listed above.
This became extremely tedious however to remember when having to type it every time I wanted to use Prolog, so I was able to add it as an alias with this command:
alias prolog='/usr/local/Cellar/swi-prolog/6.4.1/bin/swipl'
From that point on in the current terminal session, I was able to open it by just typing:
prolog
This way is obviously much easier, however you need to remember to change the alias if the version also changes.
The command "prolog" can of course be exchanged with any command you wish to use.
Keep in mind, if you want this command to be more permanent (as in after you close the terminal window), you will need to also add the above alias command to the ~/.bash_profile file so it runs on startup.
Hope this helps!
if i am not mistaken, swi-prolog required x11 to run but now in mac 10.9, there were no x11 anymore instead of xQuartz.
i am not sure if this is the real problem now.
I have just installed Octave 3.6 version on my MacBook. It uses emacs as its default editor, but it seems some regular emacs keys (such as C-x C-c for exiting) doesn't work in Octave emacs. Also, the output buffer gets completely messed when I try to use octave. Also, it always prints the prompt even when I'm in emacs. (See picture below)
It seems it's parsing my input in the editor on the fly. But I have no idea how this could every happen.
Can anyone tell me what the problem is and how to fix it?
My guess is that you end up running the Emacs that comes bundled with Mac OS X (an old version of Emacs that only works in text mode) and you want to change that by installing a more recent version that can run in the GUI. But that's just a wild guess.