Laravel 5安装程序只创建空文件夹

时间:2023-02-15 00:28:07

I am following the Laracasts: Build your first app in laravel - episode 2. I have also went through the Laravel 5 Docs. After installing the laravel installer I run 'laravel new blog' but all it does is create an empty folder. Why is that?

我正在关注laracast:在laravel -第二集中创建你的第一个应用。我也浏览了Laravel 5文档。安装laravel安装程序后,我运行了“laravel new blog”,但它只创建一个空文件夹。这是为什么呢?

My bash_profile file reads

我的bash_profile文件读取

export PATH=/Applications/MAMP/bin/php/php5.5.10/bin:$PATH
export PATH=$HOME/bin:$PATH
export PATH=$PATH:~/.composer/vendor/bin/
export PATH=$PATH:~/.composer/vendor/bin
export PATH="/usr/local/bin:$PATH"

导出路径=/应用程序/MAMP/bin/php/php5.5.10/bin:$PATH导出路径=$HOME/bin:$PATH导出路径=$PATH:~/.composer/供应商/bin/导出路径=$PATH:~/.composer/vendor/bin导出路径="/usr/local/bin:$PATH"

2 个解决方案

#1


4  

It happens because it is trying to use the old laravel installer installed on /usr/local/bin.

这是因为它试图使用安装在/ usr/local/bin上的旧的laravel安装程序。

You just have to delete that with:

你只需要删除它:

sudo rm /usr/local/bin/laravel

sudo rm /usr/local/bin/laravel

And that's all, this worked for me!

就这样,我成功了!

#2


0  

I had the same problem. In my case (Debian 7.8)

我也有同样的问题。以我为例(Debian 7.8)

First try to call the installer by its full path:

首先尝试调用安装程序的完整路径:

/home/_your_username_/.composer/vendor/bin/laravel new _your_projectname_

If it works like that then I guess you have your $PATH setup in the wrong order.
I first had installed laravel 4 installer in /usr/local/bin/laravel following this instructions http://laravel.com/docs/4.1

如果它是这样工作的,那么我猜你的$PATH设置顺序是错误的。我首先在/usr/local/bin/laravel安装了laravel安装程序,并按照下面的说明http://laravel.com/docs/4.1安装

Then I installed the new laravel 5 installer following this instructions: http://laravel.com/docs/5.0

然后,我安装了新的laravel 5安装程序,并遵循以下指令:http://laravel.com/docs/5.0。

So the problem was, because I used

问题是,因为我用过

export PATH="$PATH:~/.composer/vendor/bin"

to add the binary to my $PATH it was placed at the end of the list and the old installer was found first. Use

要将二进制文件添加到我的$PATH中,它被放在列表的末尾,旧的安装程序首先被找到。使用

export PATH="~/.composer/vendor/bin:$PATH"

instead, so it gets added in front of /usr/local/bin/ Then it should work.

相反,它被添加到/usr/local/bin/前面,那么它应该可以工作。

#1


4  

It happens because it is trying to use the old laravel installer installed on /usr/local/bin.

这是因为它试图使用安装在/ usr/local/bin上的旧的laravel安装程序。

You just have to delete that with:

你只需要删除它:

sudo rm /usr/local/bin/laravel

sudo rm /usr/local/bin/laravel

And that's all, this worked for me!

就这样,我成功了!

#2


0  

I had the same problem. In my case (Debian 7.8)

我也有同样的问题。以我为例(Debian 7.8)

First try to call the installer by its full path:

首先尝试调用安装程序的完整路径:

/home/_your_username_/.composer/vendor/bin/laravel new _your_projectname_

If it works like that then I guess you have your $PATH setup in the wrong order.
I first had installed laravel 4 installer in /usr/local/bin/laravel following this instructions http://laravel.com/docs/4.1

如果它是这样工作的,那么我猜你的$PATH设置顺序是错误的。我首先在/usr/local/bin/laravel安装了laravel安装程序,并按照下面的说明http://laravel.com/docs/4.1安装

Then I installed the new laravel 5 installer following this instructions: http://laravel.com/docs/5.0

然后,我安装了新的laravel 5安装程序,并遵循以下指令:http://laravel.com/docs/5.0。

So the problem was, because I used

问题是,因为我用过

export PATH="$PATH:~/.composer/vendor/bin"

to add the binary to my $PATH it was placed at the end of the list and the old installer was found first. Use

要将二进制文件添加到我的$PATH中,它被放在列表的末尾,旧的安装程序首先被找到。使用

export PATH="~/.composer/vendor/bin:$PATH"

instead, so it gets added in front of /usr/local/bin/ Then it should work.

相反,它被添加到/usr/local/bin/前面,那么它应该可以工作。