As you may tell from the screenshot I have included. I'm trying to get rbenv ruby 2.1.2 to replace the system ruby on Raspberry pi and there's no earthly reason it should still be pointed at 1.9.3!
Thanks to a lot of help from #dteoh, I was finally able to ascertain how this happened.
As it turns out, when I was doing my rbenv install 2.1.2 the process was taking so long I went to bed. I didn't put it together until the ~/.rbenv/shims was empty, but one of my digital clocks was blinking. Apparently that night I lost power in the night, which put it in some strange state.
The fix was blowing away the Ruby version and doing another (long) but successful Ruby build.
Thank you for your patience in this RARE but troublesome situation.
run rbenv version, you may find that a env var named RBENV_VERSION was set, after unsetting the env var using export RBENV_VERSION=, you will have the correct ruby version
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.
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.
What's the easiest way to cause a segfault intentionally in MRI Ruby 1.8.7?
You might check out segfault4r (it was last updated in 2007). You have to download and install the gem manually, as it's not available through RubyGems.
You could write a bad C module that de-references a NULL pointer.
Depending on your needs (and environment) you could get it running, find the interpreter's process ID and do:
$ kill -s SIGSEGV $pid
I just tried this on OSX with bash and it worked on an ed(1) (the one true text editor) process.
You could also run Ruby in a debugger and manually set a pointer or two to zero. One of the pointers inside a variable would do nicely. Of course, you'd probably need to have an interpreter built with debug symbols and you'd need to know a thing or two about the interpreter's internals.
If you're doing this against a specific patchlevel, look at Ruby's bug tracker for bugs that were reported after that patchlevel was created that cause a segmentation fault. As you're looking at 1.8.7, you'll probably want to look at those categorized as Ruby 1.8 .
For example, for the version of Ruby (1.9) I have on my Windows machine, Thread.kill(nil) is sufficient to cause a segfault, and I think it applies to Ruby 1.8 as well.
My question is, why does rubygems on Ubuntu not add /var/lib/gems/1.8/bin to $PATH ?
I see in the
https://help.ubuntu.com/community/RubyOnRails#Installing%20RubyGems
page that it says you have to add it yourself, but I don't understand why there is an extra step.
Testing it on a Debian system, rubygems does does not make the modification to $PATH automatically.
I'm wondering if this is a bug, or if I'm misunderstanding something - I know Ubuntu and Debian have many differences, perhaps this is just one of them.
I posted the question to answers.launchpad.net but have not yet gotten any response.
RubyGems never adds anything to the $PATH, whether on Ubuntu or otherwise. Nor does APT (or any other packaging system I know).
The $PATH variable is clearly in the user's domain. No program should ever mess with it.
See https://bugs.launchpad.net/ubuntu/+source/gems/+bug/145267. Basically, the Ubuntu team has known about this problem for years, but a bunch of infighting has prevented any progress from being made.
mac os x how to upgrade to ruby 1.9.2
Perhaps not the answer you're looking for in the short term, but I highly recommend looking into Ruby Version Manager. It makes running concurrent versions of Ruby a breeze by switching out the entire environment for you (by means of updating your environment variables, generally). Different versions, different gems per version, etc.
I think that the best option is to use Homebrew. The installation is simple:
brew install ruby
By the way, RVM does not support LLVM based gcc!
P. S. Homebrew is great choice because it has clear and good way to install things (without ruining your system), you can use it to install various "packages" like git, ghc, emacs etc.
P. P. S. Don't forget to path your new ruby, something like:
export PATH="$PATH:/usr/local/opt/ruby/bin"]
P. P. P. S. If you would like to use rvm, try this link: http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/
RVM main site doesn't install properly on OS X Lion. The instructions are incorrect, the error messages it spews are incorrect (refer to non-existent log files, etc).
Route that (eventually) worked for me:
Open Xcode, go to Preferences - Downloads
Make sure that "Command Line Tools" is installed (150 MB download); this is (silently) required for Ruby to install, and used to be part of OSX / Xcode by default, but no longer
Ignore the RVM website - it links to bad installers for OS X (don't bother, not worth the pain. I tried them, they failed)
use JewelryBox, which is a little less rubbish than the official installer: http://unfiniti.com/software/mac/jewelrybox
Run it, click Add Ruby, select ruby-1.9.3-p125 (has to be that version or higher, or it won't compile, because the previous versions need a compiler thats no longer in OS X)
Select "Autodetect" and "use clang"
...wait a LONG time...
If JewelryBox crashes immediately, it means you missed either step 2 above, or step 6 above (RVM crashes spectacularly if clang isn't installed, and neither RVM nor jewelrybox checks in advance)
NB -- downloading will take approx 5 mins; "installing" will take 30-45 mins, because everything has to be compiled. There is apparently no "normal" way of installing Ruby :(.