我想在Nginx上做基本的auth.我在Ubuntu 14.04上启动并运行1.9.3版,它可以在一个简单的html文件中正常工作.
这是html文件:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
"Some shoddy text"
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这是我的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;
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;
server {
listen 80;
server_name 192.168.1.30;
location / {
root /www;
index index.html;
auth_basic …Run Code Online (Sandbox Code Playgroud) 当我尝试运行此命令时:
gem install bcrypt -v '3.1.10'
Run Code Online (Sandbox Code Playgroud)
之后,我收到此错误:
current directory: /usr/local/rvm/gems/ruby-2.3.0@app2/gems/bcrypt-3.1.10/ext/mri
make "DESTDIR="
compiling bcrypt_ext.c
compiling crypt_blowfish.c
compiling wrapper.c
compiling crypt.c
compiling crypt_gensalt.c
linking shared-object bcrypt_ext.so
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make: *** [bcrypt_ext.so] Error 1
make failed, exit code 2
Run Code Online (Sandbox Code Playgroud)
我做了什么来解决这个问题:
- 通过rvm重新安装ruby
- 更新和安装的包:
sudo apt-get update
sudo apt-get install curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev make g++ gcc
Run Code Online (Sandbox Code Playgroud)
之后,仍然会得到同样的错误
我的环境:
vagrant@vagrant-ubuntu-trusty-64:/vagrant$ lsb_release -r
Release: 14.04
vagrant@vagrant-ubuntu-trusty-64:/vagrant$ ruby -v …Run Code Online (Sandbox Code Playgroud)