我正在尝试使用composer require friendsofsymfony/user-bundle "~2.0"
安装FOSUserBundle,但是发生错误:
Fatal error: Out of memory (allocated 1453326336) (tried to allocate 268435456 b
ytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Depe
ndencyResolver/Solver.php on line 220
我已经搜索了这个问题,并且找到了这个答案: Composer require runs out of memory. PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted
我已将php.ini更改为1024M,但是什么也没有改变(即使Composer更新也会产生相同的错误),然后什么也没有改变为-1。
我想知道在哪里可以找到composer.phar来使用此命令(我已经通过wondows安装程序安装了composer):
php -d memory_limit=-1 composer.phar require hwi/oauth-bundle php-http/guzzle6-adapter php-http/httplug-bundle
更新:
C:\wamp\www\sym>composer diag
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB
723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E32
8C AD90147D AFE50952
OK
Checking composer version: WARNING
You are not running the latest stable version, run `composer self-update` to upd
ate (1.4.1 => 1.8.5)
C:\wamp\www\sym>composer require friendsofsymfony/user-bundle
Using version ^2.1 for friendsofsymfony/user-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocat
e 12 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Compose
r/DependencyResolver/Solver.php on line 220
Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-error
s for more info on how to handle out of memory errors.
C:\wamp\www\sym>
Wampserver是一个32位的Wamp服务器吗?需要wapm 64位吗?
答案 0 :(得分:0)
将php.ini值更改为 -1 。它将允许作曲家使用您的所有可用内存。
运行require 'rails_helper'
RSpec.describe CoachesController, type: :controller do
describe 'GET #index' do
context 'when athlete is logged in' do
let(:coach) { build_stubbed(:coach) }
login_athlete
it 'redirects to coach booking url if has an associated coach' do
subject.current_athlete.coach_id = coach.id
get :index
is_expected.to redirect_to(booking_coach_path(subject.current_athlete.coach_id))
end
it 'renders index template if has no associated coach' do
get :index
is_expected.to render_template(:index)
end
end
context 'when coach is logged in' do
login_coach
it 'redirects to coach dashboard url' do
get :index
is_expected.to redirect_to(authenticated_coach_root_path)
end
end
end
end
检查作曲者的状态,然后重试composer diag
如果仍然无法使用,则可能是互联网连接问题
答案 1 :(得分:0)
这是我的方式
T
您必须使用反引号而不是单引号,但是我从来没有遇到过问题。
您还可以使用composer.phar文件的realpath
php -d memory_limit=-1 `which composer` require hwi/oauth-bundle php-http/guzzle6-adapter php-http/httplug-bundle
或
/usr/bin/composer.phar
答案 2 :(得分:0)
有些事情会大有帮助。