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.
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 need a debug version of glibc.I have some doubts regarding the installation of glibc-2.29 from source in kali linux.Based on the post https://www.tldp.org/HOWTO/html_single/Glibc-Install-HOWTO/,
To install glibc you need a system with nothing running on it, since many processes (for example sendmail) always try to use the library and therefore block the files from being replaced. Therefore we need a "naked" system, running nothing except the things we absolutely need. You can achieve this by passing the boot option
init=/bin/bash to your kernel.
it says that we need to install the glibc in a single usermode environment.In another post https://www.tldp.org/HOWTO/Glibc2-HOWTO-5.html
single usermode is not required for installation but backing up the old libraries.I dont know which one to follow.Can anyone help?
I found that we can use glibc without installing but building from source by adding '-g' flag in ./configure and setting LD_LIBRARY_PATH varible as follows after building
LD_LIBRARY_PATH=/path/to/the/build_directory gdb -q application
Note: this solution only works when the system GLIBC and the built-from-source GLIBC exactly match, as explained here.
I need a debug version of glibc.
Most distributions supply ready-made libc6-dbg packages that match your installed GLIBC. This is the best approach unless you are a GLIBC developer (or plan to become one).
I have some doubts regarding the installation of glibc-2.29 from source in kali linux.
Installing / replacing system libc is almost guaranteed to render your system unbootable if there are any mistakes. Recent example.
Before you begin, make sure you either know how to recover from such a mistake (have a rescue disk ready and know how to use it), or you have nothing of value on the system and can re-image it from installation media in the likely case that you do make a mistake.
The document you referenced talks about upgrading from libc5 to libc6. It was last updated on 22 June 1998, and is more than 20 years old. I suggest you find some more recent sources. Current documentation does suggest doing make install while in single-user mode.
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
this is probably a total newbie question but try as I might, I cannot seem to get my terminal to recognize the psql command. So far, I have tried the following:
Added PATH="/Applications/Postgres.app/Contents/Versions/9.3/bin:$PATH" to my .profile file, saved, and reopened terminal. No luck. (Path that is given in the Postgres.App installation instructions on their site.)
Added PATH="/Applications/Postgres.app/Contents/Versions/9.3/bin:$PATH" to my .bash_profile file, saved, and reopened terminal. No luck. (Tried another file to be sure.)
Added export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH" to my .profile file, saved, and reopened terminal. No luck. (Recommended in another question asked here on Stack.)
Same deal as previous but in .bash_profile. No luck.
Same deal but with /Users/my_user/Library/Application Support/Postgres/var-9.3 in both .profile and .bash_profile. No luck. (Data directory given in the app preferences, running out of ideas.)
What am I missing? This shouldn't be this hard. Thanks for the help!
Okay, so it never ceases to amaze me how much is knowledge is assumed by the courses, programs, and even installation instructions dealing with unix based systems. Like I thought, it was a silly issue.
I've heard repeatedly and from multiple sources that to make sure changes are applied, restart your terminal. Well, in this case, that is not enough. If you find yourself in the same situation, you must either restart your computer or (and much more simply) issue the following command in terminal:
source ~/.bash_profile
While a silly little issue, ignorance doesn't care and your stuff won't work until eradicate said ignorance. The good thing is that with each new hard won gem of knowledge, that's one more thing I won't forget anytime soon and insight into how to better diagnose future problems.
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.