对于我的远程存储库,我试图忽略我的Umbraco网站的web.config文件..gitignore位于我的网站的根目录中,要忽略的文件,web.config也在我的网站的根目录中.
所以我将这一行添加到我的.gitignore文件中:
web.config
Run Code Online (Sandbox Code Playgroud)
但每次我将更改推送到远程存储库时,web.config文件也会被推送到远程存储库.
我究竟做错了什么?
我正在通过W3C验证服务运行我的网站.我收到以下HTML的错误消息:
<section class="about">
<article>
<header>
<h1>Mission</h1>
</header>
<div class="content">
<p>bla bla bla</p>
</div>
<aside>
<img src='/images/logo-hse-250x250.png' />
</aside>
</article>
</section>
Run Code Online (Sandbox Code Playgroud)
W3C验证错误是:
考虑仅将
h1元素用作顶级标题(所有h1元素都被许多屏幕阅读器和其他工具视为顶级标题).Run Code Online (Sandbox Code Playgroud)<h1>Mission</h1>
我认为HTML5允许h1在页面上使用多个标签.并且该h1标签可以在article元素内部使用.
有没有人知道为什么W3C没有验证这个HTML?
我想将 setter 挂钩 (setValuesList) 从父组件 (App.tsx) 传递到子组件 (AddNumber.tsx)
我在父组件中定义了钩子,如下所示:
const [valuesList, setValuesList] = useState<number[]>([]);
Run Code Online (Sandbox Code Playgroud)
我想将钩子传递给子组件,如下所示:
<AddNumber valuesList={valuesList} setValuesList={setValuesList} />
Run Code Online (Sandbox Code Playgroud)
但是我收到打字稿错误:
(JSX attribute) AppProps.setValuesList: (num: number) => void
Type 'Dispatch<SetStateAction<number[]>>' is not assignable to type '(num: number) => void'.
Types of parameters 'value' and 'num' are incompatible.
Type 'number' is not assignable to type 'SetStateAction<number[]>'.ts(2322)
AddNumber.tsx(5, 3): The expected type comes from property 'setValuesList' which is declared here on type 'IntrinsicAttributes & AppProps'
Run Code Online (Sandbox Code Playgroud)
在子组件中,我为 props 定义一个接口,如下所示:
interface AppProps {
valuesList: number[]; …Run Code Online (Sandbox Code Playgroud) 我正在尝试部署Rails 5.1应用程序.我已经多次部署应用程序没有问题,但现在,我突然从Capistrano收到此错误消息
00:13 deploy:cleanup
SSHKit::Command::Failed: rm exit status: 1
rm stdout: Nothing written
rm stderr: rm: cannot remove '/opt/www/absence-
registrator/releases/20171017091250/node_modules/jquery/dist/jquery.js':
Permission denied
Tasks: TOP => deploy:cleanup
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as
user@myapp.com: rm exit status: 1 ?
rm stdout: Nothing written
rm stderr: rm: cannot remove '/opt/www/absence-
registrator/releases/20171017091250/node_modules/jquery/dist/jquery.js':Permission denied
rm: cannot remove '/opt/www/absence-registrator/releases/20171017091250/node_modules/jquery/dist/jquery.slim.js': Permission denied rm: cannot remove '/opt/www/absence-registrator/releases/20171017091250/node_modules/jquery/dist/jquery.min.js': Permission denied rm: cannot remove '/opt/www/absence-registrator/releases/20171017091250/node_modules/jquery/dist/jquery.min.map': Permission …Run Code Online (Sandbox Code Playgroud) 目前我正在做Daniel Kehoe的Learn Ruby on Rails教程.其中一项练习是使用Google的Gmail帐户从"联系"页面发送联系表单.
但是,当我发送联系表单而不是在我的邮箱中收到电子邮件时,我收到此错误:
"SMTP-AUTH已请求但缺少用户名"
在我的config/application.yml文件中,我设置了Gmail用户名和密码.
有谁知道可能是什么问题?
谢谢你的帮助,
安东尼
对于我编辑记录的集成测试,我尝试用新文本替换表单输入字段中的现有文本:
find("input[@id='course_title']").set("a safer workplace")
Run Code Online (Sandbox Code Playgroud)
但是,每次我检查页面时
save_and_open_page
Run Code Online (Sandbox Code Playgroud)
输入字段中的文本不会替换为新测试.
如何在Capybara中将输入字段的文本值替换为新的文本值?
谢谢你的帮助,
安东尼
对于我的AdLit Web应用程序,我将一些图像存储在Amazon AWS S3上.但是这些图像无法在任何版本的Internet Explorer中呈现(使用IE8,IE9和IE11测试)
你可以看看这个:
图像在Safari,Firefox和Chrome中呈现,但在Internet Explorer中不呈现.
有没有人有这个问题的经验?它怎么能修复?
谢谢你的帮助,
安东尼
我在最新的 Rails (4.2.6) 项目中使用回形针 5.0.0.beta2。该应用程序托管在 Heroku 上。我可以上传图像,它似乎存储在 Amazon S3 上的存储桶中。然而,在浏览器中,图像的 url 似乎已损坏,尽管它指向 Amazon S3 上的存储桶,但该 url 为:
当我在浏览器中输入此 url 时,我会收到一个带有以下错误消息的 xml 页面:
The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
Run Code Online (Sandbox Code Playgroud)
S3 端点似乎存在问题。
但是我在配置文件中设置了区域(eu-west-1):
config/environments/production.rb
config.paperclip_defaults = {
storage: :s3,
s3_region: ENV.fetch('AWS_REGION'),
s3_credentials: {
bucket: ENV.fetch('S3_BUCKET_NAME'),
access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'),
}
}
Run Code Online (Sandbox Code Playgroud)
我的 Github 存储库位于:
https://github.com/acandael/gigbnb
有人知道发生了什么事吗?
感谢您的帮助,
安东尼
我在我的Rails 4项目中安装了Fabrication和Faker
我创建了一个fabrarication对象:
Fabricator(:course) do
title { Faker::Lorem.words(5) }
description { Faker::Lorem.paragraph(2) }
end
Run Code Online (Sandbox Code Playgroud)
我在我的courses_controller_spec.rb测试中调用了Faker对象:
require 'spec_helper'
describe CoursesController do
describe "GET #show" do
it "set @course" do
course = Fabricate(:course)
get :show, id: course.id
expect(assigns(:course)).to eq(course)
end
it "renders the show template"
end
end
Run Code Online (Sandbox Code Playgroud)
但由于某种原因,测试在第6行失败:
course = Fabricate(:course)
Run Code Online (Sandbox Code Playgroud)
错误消息是:
Failure/Error: course = Fabricate(:course)
TypeError:
can't cast Array to string
Run Code Online (Sandbox Code Playgroud)
不知道为什么这会失败.有没有人遇到与Faker相同的错误消息?
我正在尝试上传我的 Rails 应用程序:
bin/cap production deploy
Run Code Online (Sandbox Code Playgroud)
但部署失败并显示此错误消息:
You have requested:
capistrano ~> 3.3.0
The bundle currently has capistrano locked at 3.7.1.
Try running `bundle update capistrano`
If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`
Run Code Online (Sandbox Code Playgroud)
我试图通过运行来解决这个问题:
bundle update capistrano
Run Code Online (Sandbox Code Playgroud)
但这并没有解决它。
我不明白的是我没有看到我的应用程序“要求 capistrano 3.3.0”。在我的 Gemfile 中,我将 Capistrano 设置为 3.7 版。
除了 capistrano gem 外,我还在使用:
gem capistrano-rails, '~> 1.2'
gem capistrano3-delayed-job, '~> 1.3'
gem capistrano-figaro-yml
Run Code Online (Sandbox Code Playgroud)
我的 Gemfile 位于:
https://github.com/acandael/personalsite/blob/master/Gemfile
有人知道我如何解决这个 Capistrano 版本问题吗?
感谢您的帮助, …
capistrano ×2
amazon-s3 ×1
capybara ×1
faker ×1
git ×1
html5 ×1
paperclip ×1
react-hooks ×1
reactjs ×1
rspec ×1
smtp-auth ×1
typescript ×1
umbraco ×1