rbenv error on newly updated mac os x 10.10.1 - ruby

Hi Im a newbie to ruby and rails and terminal and I updated to mac os x 10.10 yosimite and these errors started popping up when I open up terminal
-bash: /Users/marklacsamana/.bash_profile: line 4: syntax error near unexpected token `then'
-bash: /Users/marklacsamana/.bash_profile: line 4: `export PATH=${PATH}:/Users/marklacsamana/Development/adt-bundle-mac-x86_64-20140702/sdk/platform-tools:/Users/marklacsamana/Development/adt-bundle-mac-x86_64-20140702/sdk/toolsif which rbenv > /dev/null; then eval "$(rbenv init -)"; fi'

It looks like your .bash_profile file is malformed at sdk/toolsif which. I reckon that should be sdk/tools; if which or simply add a linebreak after tools in front of the if.

Related

Command that is not found in Mac os Terminal

I am trying to install mySQL on macOS Mojave. I have installed mySQL Community Server 8.0.17 and then attempted to configure the command line to recognize mySQL commands by using the following code in Terminal:
echo ‘export PATH=/usr/local/mysql/bin:$PATH’ >> ~/.bash_profile
Followed by:
.~/.bash_profile
After entering this last line of code, I get the following message:
-bash: ‘export: command not found
Can anyone help me to troubleshoot this problem. I'm new to coding, so I'm not sure how to rectify this error. Thank you for your help.
The problem is in:
echo ‘.......’ >> ~/.bash_profile
in your quotes. Seems you are using TextEdit app or Notes app which by default translate normal quotes
'
into
’
So this will work for you:
echo 'export PATH=/usr/local/mysql/bin:$PATH' >> ~/.bash_profile

rbenv command not found on Mac OS

We are trying to run rbenv on El-Capitan 10.11.6. When we try to run rbenv command in the terminal we got the following error message:
command not found
We googled how to solve that issue and one possible solution is to add the "rbenv" to the system PATH, we followed the steps stated in this link. When we run the "$PATH" to check whether or not the rbenv path was added properly into the system PATH, we got the the same result:
command not found
The result of "$PATH" command is:
qwe-Mac-mini:~ amrbakri$ rbenv
-bash: rbenv: command not found
qwe-Mac-mini:~ asd$ echo $PATH
/Users/asd/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/MacGPG2/bin
Can you please tell me how to add the path of rbenv properly? And what did I do wrong in the previous steps so that I can fix it.
rbenv isn't a normal command if you've installed it correctly:
$ type rbenv
rbenv is a function
. . .
According to Homebrew on Mac OS X:
You'll only ever have to run rbenv init once.
That's a bit misleading because the result of running the command is:
$ rbenv init
# Load rbenv automatically by appending
# the following to ~/.bash_profile:
eval "$(rbenv init -)"
So you need to manually add eval "$(rbenv init -)" to some file that bash will source on startup. For most people ~/.bash_profile is the right place.
I notice the commands you listed seem to be run from two different users: amrbakri and asd. Combined with the question's use of "we", I wonder if there might be a problem with the environment being set correctly for one user, but not the other. Can you try using just one user?
If you are running from a non-interactive shell (such as in a crontab), you might need to add eval "$(rbenv init -)" to the startup script.
I following the instructions about "bash" command, then do the "eval" operation.
I'm in MacOS 11.2.3, in your .bash_profile, add the two lines.
export PATH="$HOME/.rbenv/bin:$PATH"#this is the required step for my mac
eval "$(rbenv init -)"
refer: https://github.com/rbenv/rbenv#homebrew-on-mac-os-x

Terminal Bash Error on startup

Every time I launch terminal, I keep getting this syntax error.
-bash: /Users/Jake/.bash_profile: line 2: syntax error near unexpected token `then'
-bash: /Users/Jake/.bash_profile: line 2: `alias mysql='/Applications/XAMPP/xamppfiles/bin/mysql'if which rbenv >
/dev/null; then eval "$(rbenv init -)"; fi'
How do I fix this?
if you don't want that alias just edit your /Users/Jake/.bash_profile and remove or comment that line with a # at the begininning . If you do want that alias please post your .bash_profile so we can look at what the error is.
Hope it helps

Homebrew on Mac OS X (El Capitan): syntax error near unexpected token `{

I'm trying to install Homebrew on OS X El Capitan.
I used the following command to install Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
So far it worked. But then if I tried to run any brew command, for example:
brew help
I got the error:
-bash: /usr/local/bin/brew: /bin/bash^M: bad interpreter: No such file or directory
So I tried both top answers of this thread (which sets the file format of brew to unix). Now, whatever brew command I run (e.g. brew doctor or brew help), I get:
: command not foundbrew.sh: line 2:
'usr/local/Library/brew.sh: line 3: syntax error near unexpected token `{
'usr/local/Library/brew.sh: line 3: `odie() {
How do I fix this syntax error so I'm finally able to use Homebrew? Thanks in advance for any advice!
EDIT: Clarifying.
^M usually means \r as in \r\n which is windows line endings.
You should try to open /usr/local/bin/brew and save it with unix line endings or use the command line to dos2unix to do the job for you:
dos2unix /usr/local/bin/brew
You might encounter other files with the same problem, eg: usr/local/Library/brew.sh

Why do I get "No such file or directory-bash: rvm: command not found" on Terminal startup?

When I open Terminal, I get this error before I enter a command:
-bash: /Users/*username*/.rvm/scripts/rvm ]] && source /Users/*username*/.rvm/scripts/rvm # This loads HOME/.rvm/scripts/rvm: No such file or directory-bash: rvm: command not found
I can't find a way to remove this. I used rvm implode to uninstall RVM.
In another response on here it said to remove the first two lines from the /etc/profile file, however the lines were not there.
I'm using os x 10.8.4

Resources