I'm on Ubuntu 14.04 and I've been trying all possible methods to install Laravel to no avail. Error messages everything I try. I'm now trying the first method in the quickstart documentation, that is, via Laravel Installer, but it says to "Make sure to place the ~/.composer/vendor/bin directory in your PATH so the Laravel executable is found when you run the Laravel command in your terminal." so my question is, how do I do that? This may be a simple question but I'm really frustrated and would appreciate any help.
当前回答
在Fedora:
有些composer bin不在.composer目录中 所以你需要使用以下方法来定位它们:
locate composer | grep vendor/bin
然后在.bashrc中回显该部分
echo 'export PATH="$PATH:$HOME/{you_composer_vendor_path}"' >> ~/.bashrc
我的是"/.config/composer/vendor/bin" 干杯!
其他回答
我这样做了,它在osx上工作:
在终点站吃午餐
nano ~/.bash_profile
粘贴
export PATH=~/.composer/vendor/bin:$PATH
按control + x
按y键
按回车键
这是我在我的.bashrc文件中添加的,并且起作用了。
export PATH=“$PATH:/home/myUsername/.composer/vendor/bin”
打开Mac终端:
vi ~/.bashrc
如果你没有使用过vi,一开始看起来可能有点滑稽,所以仔细输入以下代码,按顺序:
i
export PATH="$PATH:$HOME/.composer/vendor/bin"
按ESC
:
w
按回车键
:
q
按回车键
现在您应该已经返回到正常的终端视图。
检查编写器现在有正确的路径:
cd ~/.composer
echo $PATH
如果您看到包含您的文件目录的路径(例如/Users/JeffStrongman/.composer/vendor/bin),那么您就可以开始了。
cd
然后运行安装。我在配置我的Mac使用Laravel Valet时遇到了这个问题。
示例(可选)
valet install
这是用于在Mac OS X 10.9.5版本上设置PATH。
我已经尝试添加$HOME,因为我使用用户配置文件:
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
当您不使用用户配置文件时:
echo 'export PATH="$PATH:~/.composer/vendor/bin"' >> ~/.bashrc
然后重新加载:
source ~/.bashrc
我希望这对你有帮助。
要解决这个问题,请确保您找到了作曲家的路径。phar第一
我的例子是这样的
alias composer="php /Users/Your-username/composer.phar"
进入cd Users >您的用户> Command ls,查看composer. sh是否存在。Phar在那里,如果是,然后将上面的行添加到.bash_profile。请确保将用户名更改为您自己的用户名。
希望这能帮到你