【发布时间】:2017-11-24 22:04:45
【问题描述】:
我对使用命令行感到非常陌生和沮丧。我目前正在尝试安装 laravel 以与我的 PHP 应用程序一起使用。我已经安装了 composer,现在我正在尝试安装 laravel。
我首先尝试按照 documentation for laravel 上的说明进行操作:
- 已安装作曲家
- 跑
composer global require "laravel/installer" - 运行失败
laravel new blog:-bash: laravel: command not found
接下来我尝试关注 laracast video:
- 已安装作曲家
- 跑
composer global require "laravel/installer" - 打开vim ~/.bashrc 并添加
export PATH="$HOME/.composer/vendor/bin:$PATH" - 运行失败
laravel new blog:-bash: laravel: command not found
除了 laravel 仍然不可用,当我回到 bashrc 文件时,我得到以下通知:
Found a swap file by the name "~/.bashrc.swp"
owned by: Shawn dated: Wed Jun 21 16:01:37 2017
file name: ~Shawn/.bashrc
modified: YES
user name: Shawn host name: Shawns-MBP.domain
process ID: 39328
While opening file "/Users/Shawn/.bashrc"
dated: Wed Jun 21 16:19:11 2017
NEWER than swap file!
(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /Users/Shawn/.bashrc"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/Users/Shawn/.bashrc.swp"
to avoid this message.
再一次,我对这个过程感到非常困惑,根本无法理解出了什么问题以及为什么它对其他人有效,但我似乎无法正确安装 laravel。
【问题讨论】:
-
通过附加现有的 with 将作曲家路径添加到 .bash_profile 中:不要忘记重新运行它或简单地注销并重新登录
-
或者,您也可以通过在终端中发出 Composer create-project 命令来安装 Laravel (laravel.com/docs/5.4/installation#installing-laravel):composer create-project --prefer-dist laravel/laravel blog
标签: php bash macos laravel vim