etc/bash.bashrc: line 2: GREP_OPTIONS: command not found - ruby-on-rails

When I run a command on my Ubuntu 12 server I get the following warning...
etc/bash.bashrc: line 2: GREP_OPTIONS: command not found
I've probably messed something up by uninstalling various Rails pieces. How can I fix this? This is for the root user. Thanks.
The beginning of my bashrc file has the following...
type rvm >/dev/null 2>/dev/null || echo ${PATH} | GREP_OPTIONS \grep
"" > /dev/null || export PATH="${PATH}:"

It appears that you have uninstalled rvm from your system, as it cannot find $rvm_path_bin. I would recommend commenting out the line from /etc/bash.bashrc.

Related

How to instsall nix-linter

I've tried to install nix-linter with 3 way. None works
nix package manager
nix-env -iA nixpkgs.nix-linter
Package is marked as broken, refusing to evaluate.
It propose me several option to add broken package ( export NIXPKGS_ALLOW_BROKEN=1 ). But I don't understand exactly what will be the repercutions. I prefer not to follow this option
with cachix
I follow this tutorial
and add this line
echo "trusted-users = root myusername" | sudo tee -a /etc/nix/nix.conf && sudo pkill nix-daemon
normally after cachix use nix-linter there is a cache that nix-build use
But it doesn't work. I get an error saying that there is no default.nix in my repository
https://github.com/Synthetica9/nix-linter
cachix use nix-linter
git clone https://github.com/Synthetica9/nix-linter
cd nix-linter
$(nix-build -A nix-linter)/bin/nix-linter --help
error: attribute 'nix-linter' in selection path 'nix-linter' not found
-bash: /bin/nix-linter: No such file or directory
somebody from cacheix said that this package is no longer maintain and I should try statix.
statix works

How to get asdf and rvm to co-exist

Is it possible to have asdf and rvm coexist? If so, how do you set it up? I made a test project to try out asdf but it seems that's affecting another existing project that's managed by rvm. When I run rails I'm getting:
asdf: No version set for command ruby
you might want to add one of the following in your .tool-versions file:
ruby 2.6.1
I've came across the same issue while installing asdf in macOS. I was able resolve it by creating .tool-versions file and adding the ruby version entry. You can do the same by running following command in the terminal.
$ echo 'ruby 2.6.1' >> .tool-versions
more information can be found here in this blog post
This is the hack I currently use. Running use-rvm or use-asdf uncomments the respective line in my ~/.bash_profile, and comments the unwanted line.
# RVM
# source $HOME/.rvm/scripts/rvm
# ASDF
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
# Add Visual Studio Code (code)
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
use-rvm () {
sed -i "" 's|^# source $HOME/.rvm/scripts/rvm|source $HOME/.rvm/scripts/rvm|' ~/.bash_profile
sed -i "" 's|^. $HOME/.asdf/asdf.sh|# . $HOME/.asdf/asdf.sh|' ~/.bash_profile
bash --login
}
use-asdf () {
sed -i "" 's|^source $HOME/.rvm/scripts/rvm|# source $HOME/.rvm/scripts/rvm|' ~/.bash_profile
sed -i "" 's|^# . $HOME/.asdf/asdf.sh|. $HOME/.asdf/asdf.sh|' ~/.bash_profile
bash --login
}
And here's the gist

Neo4j lsof: command not found at db server startup

I am getting an endless stream of errors (as follows) when attempting to start the database server - until I am stopping it with CTRL + C in the terminal. Does anyone have idea what is wrong?
$ rake neo4j:start
Starting Neo4j development...
db/neo4j/development/bin/neo4j: line 147: lsof: command not found
db/neo4j/development/bin/neo4j: line 147: lsof: command not found
db/neo4j/development/bin/neo4j: line 147: lsof: command not found
db/neo4j/development/bin/neo4j: line 147: lsof: command not found
^Crake aborted!
Interrupt:
For me the below worked:
yum install lsof
I solved this after I added /usr/sbin to the PATH.
Here it is:
levi$ echo $PATH
/Users/levi/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin/:/Applications/Sublime Text.app/Contents/SharedSupport/bin
Instead lsof ,,,,,, Try to use
/usr/sbin/lsof $FILE
Where $FILE is path of a file
According to colucix, the lsof command is available only to root.
if you want to run it as a non root user, you can specify its full path.
$ /usr/sbin/lsof /path/to/some/file
Also Philip Reynolds has pointed out that you can specify an sudo alias for lsof if it suites you.
In ubuntu 16.04 it worked after installing lsof
sudo apt-get install lsof

Issue with Installation of Ruby & RVM; No such file or directory

Good afternoon,
I'm new at this and I think I did something wrong when trying to install Ruby with RVM. Here is what my terminal shows when I open it:
Last login: Sun Oct 13 13:17:20 on ttys000
-bash: i[ -s /Users/<Username>/.rvm/scripts/rvm ]]: No such file or directory
Charless-MacBook-Pro-2:~ <Username>
What steps should I take to remove the error message?
Thank you for any help!
In your .bashrc or .bash_profile it looks like you need to change the
[[ -s /Users/<Username>/.rvm/scripts/rvm ]]
to this :
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Or manually set the username is a placeholder, you need to change that your username or set it to be dynamic.
Hey try the following steps.
First make sure you have the XCode Command Line Tools: 
You can add it by going to Xcode → Preferences
→ Downloads → Command Line Tools
Once you have it in your terminal try the following
$ curl -­L https://get.rvm.io | bash ­-s -stable
$ rvm get head && rvm reload
Now you want to make sure you have gcc­4.2 with 
`which gcc­4.2`
You can now try to install Ruby
$ rvm install 2.0.0
$ rvm use 2.0.0 ­­default
if you'd like a pervious version you can also do:
$ rvm install 1.9.3 # optional

About Ruby Version Manager Installation

I was trying to install RVM:Ruby Version Manager from:
http://rvm.beginrescueend.com/rvm/install/
I opened up my terminal in my mac os version 10.5.8 and use the command line
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
then I got the message,
"You must now finish the install manually:
1) Place the folowing line at the end of your shell's loading files(.bashrc or .bash_profile for bash and .zshrc for zsh), after all path/variable settings:
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
Please note that this must only occur once - so, you only need to add it the first time you install rvm.
2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly).
This means that if you see '[ -z ] && return' then you must change this line to:
if [[ ! -z ]] ; then
... original content that was below the && return line ...
fi # <= be sure to close the if.
#EOF .bashrc
Be absolutely sure to REMOVE the '&& return'.
If you wish to DRY up your config you can 'source ~/.bashrc' at the bottom of your .bash_profile.
placing all non-interactive items in the .bashrc, including the 'source' line above
3) Then CLOSE THIS SHELL and open a new one in order to use rvm.
Installation of RVM to /Users/Home/.rvm/ is complete.
kapplej-4:~ Home$ #!/usr/bin/env bash
kapplej-4:~ Home$
kapplej-4:~ Home$ # Install git
kapplej-4:~ Home$ mkdir -p $HOME/.rvm/src && cd $HOME/.rvm/src && version=1.6.5.3
kapplej-4:src Home$ curl -O http://kernel.org/pub/software/scm/git/git-$version.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2645k 100 2645k 0 0 953k 0 0:00:02 0:00:02 --:--:-- 1060k
kapplej-4:src Home$ cd git-$version && ./configure --prefix=/usr/local && make && sudo make install
-bash: cd: git-1.6.5.3: No such file or directory"
I have no idea how to complete installation manually, I am a complete newbie so can someone please give me a step by step instruction on how to do this. For eg, where do I go to add those lines to the shell's loading files?
Thanks,
Not sure why you're installing git through rvm, but my guess is that you didn't extract the tar.gz file before trying to access the directory. Before cd'ing into the git directory you'll need to do
tar -zxf git-$version.tar.gz
To complete the install you need to add the line:
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
to the end of your .bashrc file (assuming you're using bash which you can determine with echo $SHELL.)
You also need to verify that your bash script doesn't return (the -z return bit in the RVM message. If it does return do what RVM says during the install.)
Once the line is added exit your shell and open a new one. You should then be able to do rvm info to see rvm info and rvm to get more information on RVM.
If Git is already installed, the up-to-date command to install RVM is curl -L get.rvm.io | bash -s stable.

Resources