according to a document from getcomposr.org. It should be place on
usr/local/bin
.
in my case...the directory
usr/local/bin
not exist. but instead directory
/bin
existe.
so should i create
usr/local/bin
and move composer there
or
just move into
/bin
thanks you in advance.
You should read further in the documentation:
Note: On some versions of macOS the /usr directory does not exist by default. If you receive the error "/usr/local/bin/composer: No such file or directory" then you must create the directory manually before proceeding: mkdir -p /usr/local/bin.
This mkdir call should be run with sudo.
Also note that you can easily install Composer with Homebrew via brew install composer.
Related
I am trying to install Ruby on a remote server using rbenv.
However, when I run the command rbenv install 2.7.2, I get the error below:
ruby-build: TMPDIR=/tmp cannot hold executables (partition possibly mounted with noexec)
I have rbenv and other dependencies for the Ruby programming language properly installed.
After a few research and trials, I was able to solve it.
Here's how I solved it:
The issue was that the rbenv installer needed a directory to store temporary files while it is downloading and installing ruby, however, the /tmp directory which is the default directory for storing temporary files wasn't accessible by my current user.
I tried to change permissions for the /tmp directory to allow it become accessible to my current user, however, I was unsuccessful.
All I had to do was to create a new tmp directory in the home directory of my user:
mkdir ~/tmp
Next, I opened the .bashrc file in the home directory of my user:
sudo nano ~/.bashrc
Next, I added the line below to the bottom of the file and saved:
export TMPDIR="$HOME/tmp"
Finally, I restarted my terminal or ran the command below to load the newly added paths into my current shell/terminal session:
exec "$SHELL"
Now, I could run the command rbenv install 2.7.2 and it worked fine.
Resources: TMPDIR=/tmp cannot hold executables (partition possibly mounted with noexec)
Adding to the OP's answer, you don't need to create a new tmp folder. Only adding to the path should work as well.
Whenever I try to install packages through homebrew or pip, it gives me a permission error. (I'm using macOS Catalina)
I somewhat got pip to work by using the "sudo -H" prefix. It downloads them successfully but then when I attempt to import them in Python, it tells me the module wasn't found. Earlier today I changed the default version of Python to 3.8.2, but the same error was happening way before that.
Here's the Homebrew command I used:
brew install libyaml
Here's what it's returning:
Error: Permission denied # apply2files - /usr/local/lib/node_modules/json-server/node_modules/term-size/vendor/macos/.DS_Store
you need to check user permissions on the first /usr, /usr/local, and /usr/local/lib directories. you need rwx permissions to write content in these folder. Failing this permission on any folder will not allow you to modify content in /usr/local/lib.
you can use sudo chmod u+rwx folder_name to provide read write execute on the folders. If you want to providerwx permission to all folder inside /usr use sudo chmod u+rwx -R /usr
I installed python environment by means of commands:
SYS_INSTALL="apt-get install -y"
PIP_INSTALL="pip install"
# Be sure to install setuptools before pip to properly replace easy_install.
$SYS_INSTALL git
$SYS_INSTALL python-dev
$SYS_INSTALL python-setuptools
$SYS_INSTALL python-pip
$PIP_INSTALL virtualenv
also was able to create new virtual environment:
virtualenv .env
However, after running a command like:
. .env/bin/activate
I got
-bash: .env/bin/activate: No such file or directory
After reviewing folder .env/bin I found only one python file. Whole list of files here:
.env/lib:
python2.7
.env/include:
python2.7
.env/bin:
python
What is the issue here?
SOLUTION add --always-copy
virtualenv .env --always-copy
For me it works when I do these steps:
Go to the directory/folder that you want
run virtualenv .env
then run source .env/bin/activate
The accepted answer is incomplete! The suggested code left out your error, but didn't comment on it.
The command . .env/bin/activate would indeed do the same as source on the file activate in the folder .env/bin. In fact, apparently the command "source" is an alias for the command ".", and not the other way around. Note that . here has a space after it, and used differently from the . discussed below (which makes files and folders hidden).
What I notice is that you are calling your folder .env, which is not standard practice. Files and folders preceded by . are made "hidden" by Mac OS X. Standard practice is to call a virtual environment directory env or venv, and to call the virtual environment specification file .env.
So, if your spec file is called .env and your virtual environment directory is called env, you can run either
source env/bin/activate
or
. env/bin/activate.
I had the same issue and the following steps resolved it:
$mkdir annotateNLP
$cd annotateNLP
$python -m venv env
$source env/Scripts/activate
Try these commands in the terminal:
$ mkdir djangoapp
$ cd djangoapp
$ python3 -m venv myvenv
$ source myvenv/bin/activate
You can't go straight into activate command without first creating your virtual environment.
you forgot to include source before activating command is
source env/bin/activate
this question is similar to your's
virtualenv is not compatible with this system or executable
where it creates virtualenv but,python file instead of activate in bin
After going to your virtual environment folder .\Scripts\activate.
In my case, I need to install
sudo apt-get install python3-venv
$ virtualenv env
$ cd env/Scripts/
$ . activate
I was facing this same issue. I uninstalled the virtualenv in Ubuntu and then I installed it again. After this nonsense, it works and now I am able to activate my virtualenv through -$source py3/bin/activate.
If installed venv on a Windows machine, run this command (assuming you are in the working directory that has your venv folder):
In bash terminal: source venv/Scripts/activate
In cmd terminal:
venv\Scripts\activate
where venv is the folder name for your virtual environment
For windows using git bash, run the below command:-
source env\Scripts\activate
I am installing openERP following the manual in [1]: http://netbeam.in/blog/install-openerp-on-mac-osx/
I execute the next command:
tar tvfz openerp-7.0-latest.tar.gz
Before is supossed that I will execute:
sudo mv openerp_XXXXXX to home directory
cd openerp_XXXXXXX
But I donĀ“t know where is the path of openERP is installed.
Can you help me to end installing openERP?
I am use Mac OS Yosemite.
Thank you so much.
openerp is still inside the directory you extracted in step 6 (tar tvfz ....), but that directory is still located in your Downloads directory which isn't a good place to stay.
So they instruct you to move the openerp directory to your home directory: sudo mv openerp_xxxxxx /Users/<your-username>/ should be the right command. After that, the next command should be cd /Users/<your-username>/openerp_xxxxxx to go to the moved directory.
I'm working on the front end for a web app, but I'm trying to learn as much of the backend setup as I can as well. I am setting up redis on a new computer myself, but running into a few hiccups.
The wget command cannot be found, so I assume it Linux only? I am following these instructions to install redis on Mac OS 10.7. I have redis 2.0.0 installed, but while attempting to install 2.4.4 using the same commands, I am told redis-server, redis-cli, redis-benchmark cannot be found, and I can't copy them to /usr/local/bin.
I could not find an update command to bring redis up to the most recent version. I don't think it should be this difficult to install the most recent version on redis on Mac OS, but I can't see what I am doing wrong.
So far as I know, typing:
$ brew upgrade redis
should work, where $ indicates your command line. If it complains about HomeBrew not being installed, you can obtain that here. Brew is an excellent package manager, and a great way of taking care of your files.
If you're not using brew, then these steps will help you get up to date.
First, find the location of your installed redis-server instance before updating. In my case, it was in /usr/local/bin/, but it might also be in /usr/bin/. If it's not here, you can type which redis-server to find the location.
Next, download the redis tar file from https://redis.io/download, then install it from the directory it downloaded to:
cd Downloads
tar xzf redis-X.Y.Z.tar.gz
cd redis-X.Y.Z
make test
make
Next, we'll move the new installed redis to the location where the current instance is running:
sudo mv src/redis-server /usr/local/bin
sudo mv src/redis-cli /usr/local/bin
Now you should be ready to use redis-server and redis-cli in the new version.
PS - I also moved the redis-benchmark, redis-sentinel, redis-check-aof, and redis-check-dump files because they were also already in /usr/local/bin.
Ref: http://jasdeep.ca/2012/05/installing-redis-on-mac-os-x/
It would be better to follow this way.
$ brew update
$brew upgrade redis
Create a bash file...
cd ~
nano .update_redis
Go into the tmp directory and download the latest stable version
cd /tmp
wget http://download.redis.io/redis-stable.tar.gz
Decompress the files
tar xvzf redis-stable.tar.gz
Compile
cd redis-stable
make
Copy the bin programs
cp src/redis-cli /usr/bin/
cp src/redis-server /usr/bin/
cp src/redis-benchmark /usr/bin/
Set Permissions
chmod 755 /usr/bin/redis-cli
chmod 755 /usr/bin/redis-server
chmod 755 /usr/bin/redis-benchmark
Execute
bash .update_redis