我正在一个unknown directive "perl_modules"
尝试用下面的启动nginx的错误时/etc/nginx/nginx.conf
设定:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
perl_modules perl/lib;
perl_set $subdomain_uppercase 'sub {
my $r = shift;
my $subdomain = $r->subdomain;
$subdomain = uc($subdomain);
return $subdomain;
}';
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
Run Code Online (Sandbox Code Playgroud)
我安装了perl:
root@0f0babe794c4:/etc/nginx# perl -v
This …
Run Code Online (Sandbox Code Playgroud) 尝试将CA Cert导入我的Java 6信任库,并遇到此错误:
./keytool -v -import -trustcacerts -alias Rapidssl -file /Users/spurr/Desktop/rapidssl.cer -keystore /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts
Enter keystore password:
Certificate was added to keystore
[Storing /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts]
keytool error: java.io.FileNotFoundException: /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts (Operation not permitted)
java.io.FileNotFoundException: /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts (Operation not permitted)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:84)
at sun.security.tools.KeyTool.doCommands(KeyTool.java:902)
at sun.security.tools.KeyTool.run(KeyTool.java:172)
at sun.security.tools.KeyTool.main(KeyTool.java:166)
Run Code Online (Sandbox Code Playgroud)
我也以root用户身份运行该命令,因此我认为我可以访问该cacerts密钥库位置。使用Java 6。
我有一个属性希望在 a 中是可选的,belongs_to
因为用户不必立即属于团队。
class User < ActiveRecord::Base
belongs_to :team, optional: true
end
Run Code Online (Sandbox Code Playgroud)
team_id
未传入的情况下创建的用户:
irb(main):001:0> User.create()
D, [2019-08-16T18:56:53.961520 #1] DEBUG -- : (0.4ms) BEGIN
D, [2019-08-16T18:56:53.988354 #1] DEBUG -- : SQL (0.7ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2019-08-16 18:56:53.985875"], ["updated_at", "2019-08-16 18:56:53.985875"]]
D, [2019-08-16T18:56:54.017858 #1] DEBUG -- : (1.0ms) COMMIT
=> #<User id: 5, provider: nil, uid: nil, name: nil, email: nil, oauth_token: nil, oauth_expires_at: nil, created_at: "2019-08-16 18:56:53", updated_at: "2019-08-16 18:56:53", …
Run Code Online (Sandbox Code Playgroud)