在升级我的 Homestead 并安装我的软件包后,我遇到了一个奇怪的错误。随叫随到php artisan以下是输出:
In LoadConfiguration.php line 68:
Unable to load the "app" configuration file.
几个人suggest这是 Windows (10) 将文件名大写的原因。但是,这在我的文件夹中看不到,也不适用于我的 Ubuntu (18.04) 环境。
查看LoadConfiguration.php的源代码我们可以看到它正在使用 Finder来自 symfony/finder 的类(class)组件。
foreach (Finder::create()->files()->name('*.php')->in($configPath) as $file) {
$directory = $this->getNestedDirectory($file, $configPath);
$files[$directory.basename($file->getRealPath(), '.php')] = $file->getRealPath();
}
问题是查找器确实返回了一个不知何故找不到我的配置文件的迭代器。一个简单的scandir($configPath)返回所有文件:
.
..
app.php
and all other files
将调用包装在 iterator_to_array() 中返回一个空数组 [] .
添加..->in($configPath)->getIterator()返回以下对象:
Symfony\Component\Finder\Iterator\PathFilterIterator {#47
#matchRegexps: []
#noMatchRegexps: array:2 [
0 => "#(^|/)\..+(/|$)#"
1 => "#(^|/)\..+(/|$)#"
]
innerIterator: Symfony\Component\Finder\Iterator\FilenameFilterIterator {#43
#matchRegexps: array:1 [
0 => "#^(?=[^\.])[^/]*\.php$#"
]
#noMatchRegexps: []
innerIterator: Symfony\Component\Finder\Iterator\FileTypeFilterIterator {#39
-mode: 1
innerIterator: RecursiveIteratorIterator {#42
innerIterator: Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator {#46
-iterator: Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator {#48
-ignoreUnreadableDirs: false
-rewindable: null
-rootPath: "/home/vagrant/somepath/api/config"
-subPath: null
-directorySeparator: "/"
path: "/home/vagrant/somepath/api/config"
filename: "app.php"
basename: "app.php"
pathname: "/home/vagrant/somepath/api/config/app.php"
extension: "php"
realPath: "./config/app.php"
aTime: 2019-07-02 09:28:30
mTime: 2019-01-31 17:43:49
cTime: 2019-07-02 16:32:52
inode: 429
size: 9727
perms: 0100777
owner: 1000
group: 1000
type: "file"
writable: true
readable: true
executable: true
file: true
dir: false
link: false
}
-isRecursive: true
-excludedDirs: array:9 [
".svn" => true
"_svn" => true
"CVS" => true
"_darcs" => true
".arch-params" => true
".monotone" => true
".bzr" => true
".git" => true
".hg" => true
]
-excludedPattern: null
innerIterator: Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator {#48}
}
}
}
}
}
假设我对这些类型的迭代器一无所知。有两件事对我来说很突出:
innerIterator的存在。#48 ,我们可以看到我们的 config/app.php , 但在 ExcludeDirectoryFilterIterator 内.有没有人以前遇到过这个问题或者知道如何引导我朝着正确的方向前进?
使用了以下版本:
OS: Windows 10/Ubuntu 18.04 LTS
Homestead: 9.0.1
laravel/framework: 5.8.*/5.7.*
\ symfony/finder: ^4.2/^4.1,
编辑
将我的家园降级为 v8.0.1一切正常。然而仍然没有解释为什么这发生在 v9.0.1 .
最佳答案
尝试将 VirtualBox 更新到 v6。参见 this GitHub issue寻求更多帮助。
关于php - 拉维尔/Symfony : unable to load the "app" configuration file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56857532/
我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou
我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-
为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar
我遵循MichaelHartl的“RubyonRails教程:学习Web开发”,并创建了检查用户名和电子邮件长度有效性的测试(名称最多50个字符,电子邮件最多255个字符)。test/helpers/application_helper_test.rb的内容是:require'test_helper'classApplicationHelperTest在运行bundleexecraketest时,所有测试都通过了,但我看到以下消息在最后被标记为错误:ERROR["test_full_title_helper",ApplicationHelperTest,1.820016791]test
我收到这个错误:RuntimeError(自动加载常量Apps时检测到循环依赖当我使用多线程时。下面是我的代码。为什么会这样?我尝试多线程的原因是因为我正在编写一个HTML抓取应用程序。对Nokogiri::HTML(open())的调用是一个同步阻塞调用,需要1秒才能返回,我有100,000多个页面要访问,所以我试图运行多个线程来解决这个问题。有更好的方法吗?classToolsController0)app.website=array.join(',')putsapp.websiteelseapp.website="NONE"endapp.saveapps=Apps.order("
我正在尝试从Postgresql表(table1)中获取数据,该表由另一个相关表(property)的字段(table2)过滤。在纯SQL中,我会这样编写查询:SELECT*FROMtable1JOINtable2USING(table2_id)WHEREtable2.propertyLIKE'query%'这工作正常:scope:my_scope,->(query){includes(:table2).where("table2.property":query)}但我真正需要的是使用LIKE运算符进行过滤,而不是严格相等。然而,这是行不通的:scope:my_scope,->(que
我正在尝试编写一个将文件上传到AWS并公开该文件的Ruby脚本。我做了以下事情:s3=Aws::S3::Resource.new(credentials:Aws::Credentials.new(KEY,SECRET),region:'us-west-2')obj=s3.bucket('stg-db').object('key')obj.upload_file(filename)这似乎工作正常,除了该文件不是公开可用的,而且我无法获得它的公共(public)URL。但是当我登录到S3时,我可以正常查看我的文件。为了使其公开可用,我将最后一行更改为obj.upload_file(file
我是Google云的新手,我正在尝试对其进行首次部署。我的第一个部署是RubyonRails项目。我基本上是在关注thisguideinthegoogleclouddocumentation.唯一的区别是我使用的是我自己的项目,而不是他们提供的“helloworld”项目。这是我的app.yaml文件runtime:customvm:trueentrypoint:bundleexecrackup-p8080-Eproductionconfig.ruresources:cpu:0.5memory_gb:1.3disk_size_gb:10当我转到我的项目目录并运行gcloudprevie
当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub
当我在我的Rails应用程序根目录中运行rakedoc:app时,API文档是使用/doc/README_FOR_APP作为主页生成的。我想向该文件添加.rdoc扩展名,以便它在GitHub上正确呈现。更好的是,我想将它移动到应用程序根目录(/README.rdoc)。有没有办法通过修改包含的rake/rdoctask任务在我的Rakefile中执行此操作?是否有某个地方可以查找可以修改的主页文件的名称?还是我必须编写一个新的Rake任务?额外的问题:Rails应用程序的两个单独文件/README和/doc/README_FOR_APP背后的逻辑是什么?为什么不只有一个?