4

I've installed couchbase on my Macbook and now I'm struggling to import data from the csv file. If I go to

/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin

where I installed Couchbase - in terminal and run cbtransfer command I have the response "Command not found".

I tried to add this path to the $PATH. No result.

I tried to create a symbolic link and use it. No result.

I spent several hours and started to hate my Mac. Please help.

11

Since the directory above has a space included, you'll need to enclose the directory in quotes for it to work properly:

PATH=$PATH:"/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin"

In order to load the new PATH after you add the above line to your .bash_profile (you can create this file if necessary. in your home folder), you should either open a new Terminal window, or type:

source ~/.bash_profile

You can check to see if it is correct by typing:

echo $PATH

It should show the directory you've added.

Also, any time an executable is not in the PATH you need to give a proper (absolute or relative) path to the executable in order for it to run. The relative path to the PWD (present working directory) is ./, e.g. ./cbtransfer.

It is possible that your default shell is not BASH, type

echo $SHELL

to check this.

The benefit of adjusting your path in this fashion is that the change will persist across terminal sessions and reboots. You can alternately use an export command to set your path for a current terminal session.

  • 2
    The suggestion to open a new Terminal window is the one I prefer: it lets a possibility to fix in case of error (which is common :) ). – daniel Azuelos Nov 24 '16 at 6:53
  • I tried to add path to PATH. But the second command says "/Users/ xxx/.bash_profile: No such file or directory". Does it mean that profile doesn't exist? Should I create it? Also, if I open a new terminal window and check PATH, it's not changed. Thanks – mimic Nov 24 '16 at 18:11
  • Another question - should I assign PATH as you mentioned or use export command instead? One more question - is it critical, which folder is current? Thanks – mimic Nov 24 '16 at 18:12
  • Finally I was able to run the command as you mentioned in the last sentence using ./ Other solutions with adding to PATH still didn't work. – mimic Nov 24 '16 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .