我正在使用nickel.rs 构建一个Web 应用程序。一切正常,但是当我执行时cargo run
,由于高度依赖,我收到以下错误:
Compiling openssl-sys-extras v0.7.9
Compiling openssl-sys v0.7.9
Compiling openssl v0.7.9
Build failed, waiting for other jobs to finish...
failed to run custom build command for `openssl v0.7.9`
Process didn't exit successfully: `/Users/menawi/Developer/rust/nickelodean/target/debug/build/openssl-66237fc32eb1ac40/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
TARGET = Some("x86_64-apple-darwin")
debug=true opt-level=0
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = None
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-m64" "-fPIC" "-o" "/Users/menawi/Developer/rust/nickelodean/target/debug/build/openssl-66237fc32eb1ac40/out/src/c_helpers.o" "-c" "src/c_helpers.c"
ExitStatus(ExitStatus(256))
command did not execute successfully, got: exit code: 1
--- stderr
src/c_helpers.c:1:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
^
1 error generated.
thread '<main>' panicked at 'explicit panic', /Users/menawi/.cargo/registry/src/github.com-88ac128001ac3a9a/gcc-0.3.26/src/lib.rs:818
我需要 openssl 因为我的 Web 应用程序需要发出https
请求。我该如何解决这个错误?我在Cargo.toml
下面附上了我的文件的副本:
[package]
name = "nickelodean"
version = "0.1.0"
[dependencies]
nickel = "0.8.0"
mustache = "0.7.0"
rustc-serialize = "0.3.18"
hyper="0.8"