在mac上安装phusion乘客时的错误

时间:2014-09-25 14:37:14

标签: ruby-on-rails ruby macos passenger

我正在Mac OSX上安装Passenger(10.9.5)并且一直在收到错误。如果重要,Ruby 2.1.2是通过rbenv安装的,我安装了Rails 4.0.0。根据'使用Rails 4的敏捷Web开发'一书,我正在安装Passenger版本4.0.8。输入命令后

> sudo passenger-install-apache2-module

在终端中,它会引导我完成安装过程的一些提示,然后我得到以下错误部分

In file included from ext/common/Logging.cpp:31:
In file included from ext/common/Utils/IOUtils.h:39:
ext/common/FileDescriptor.h:99:2: error: unknown type name 'shared_ptr'
        shared_ptr<SharedData> data;
        ^
ext/common/FileDescriptor.h:99:12: error: expected member name or ';' after declaration specifiers
        shared_ptr<SharedData> data;
        ~~~~~~~~~~^
ext/common/FileDescriptor.h:126:4: error: use of undeclared identifier 'data'
                        data = make_shared<SharedData>(fd, autoClose);
                        ^
ext/common/FileDescriptor.h:145:7: error: use of undeclared identifier 'data'; did you mean
      'StaticString::data'?
                if (data != NULL) {
                    ^~~~
                    StaticString::data
ext/common/StaticString.h:161:14: note: 'StaticString::data' declared here
        const char *data() const {
                    ^
In file included from ext/common/Logging.cpp:31:
In file included from ext/common/Utils/IOUtils.h:39:
ext/common/FileDescriptor.h:145:7: error: call to non-static member function without an object
      argument
                if (data != NULL) {
                    ^~~~
ext/common/FileDescriptor.h:146:4: error: use of undeclared identifier 'data'; did you mean
      'StaticString::data'?
                        data->close(checkErrors);
                        ^~~~
                        StaticString::data
ext/common/StaticString.h:161:14: note: 'StaticString::data' declared here
        const char *data() const {
                    ^
In file included from ext/common/Logging.cpp:31:
In file included from ext/common/Utils/IOUtils.h:39:
ext/common/FileDescriptor.h:146:4: error: call to non-static member function without an object
      argument
                        data->close(checkErrors);
                        ^~~~
ext/common/FileDescriptor.h:147:4: error: use of undeclared identifier 'data'; did you mean
      'StaticString::data'?
                        data.reset();
                        ^~~~
                        StaticString::data
ext/common/StaticString.h:161:14: note: 'StaticString::data' declared here
        const char *data() const {
                    ^
In file included from ext/common/Logging.cpp:31:
In file included from ext/common/Utils/IOUtils.h:39:
ext/common/FileDescriptor.h:147:4: error: call to non-static member function without an object
      argument
                        data.reset();
                        ^~~~
ext/common/FileDescriptor.h:160:7: error: use of undeclared identifier 'data'; did you mean
      'StaticString::data'?
                if (data != NULL) {
                    ^~~~
                    StaticString::data
ext/common/StaticString.h:161:14: note: 'StaticString::data' declared here
        const char *data() const {
                    ^
In file included from ext/common/Logging.cpp:31:
In file included from ext/common/Utils/IOUtils.h:39:
ext/common/FileDescriptor.h:160:7: error: call to non-static member function without an object
      argument
                if (data != NULL) {
                    ^~~~
ext/common/FileDescriptor.h:161:13: error: use of undeclared identifier 'data'; did you mean
      'StaticString::data'?
                        int fd = data->fd;
                                 ^~~~
                                 StaticString::data
ext/common/StaticString.h:161:14: note: 'StaticString::data' declared here
        const char *data() const {
                    ^
In file included from ext/common/Logging.cpp:31:
In file included from ext/common/Utils/IOUtils.h:39:
ext/common/FileDescriptor.h:161:13: error: call to non-static member function without an object
      argument
                        int fd = data->fd;
                                 ^~~~
ext/common/FileDescriptor.h:162:4: error: use of undeclared identifier 'data'; did you mean
      'StaticString::data'?
                        data->detach();
                        ^~~~
                        StaticString::data
ext/common/StaticString.h:161:14: note: 'StaticString::data' declared here
        const char *data() const {
                    ^
In file included from ext/common/Logging.cpp:31:
In file included from ext/common/Utils/IOUtils.h:39:
ext/common/FileDescriptor.h:162:4: error: call to non-static member function without an object
      argument
                        data->detach();
                        ^~~~
ext/common/FileDescriptor.h:163:4: error: use of undeclared identifier 'data'; did you mean
      'StaticString::data'?
                        data.reset();
                        ^~~~
                        StaticString::data
ext/common/StaticString.h:161:14: note: 'StaticString::data' declared here
        const char *data() const {
                    ^
In file included from ext/common/Logging.cpp:31:
In file included from ext/common/Utils/IOUtils.h:39:
ext/common/FileDescriptor.h:163:4: error: call to non-static member function without an object
      argument
                        data.reset();
                        ^~~~
ext/common/FileDescriptor.h:177:7: error: use of undeclared identifier 'data'; did you mean
      'StaticString::data'?
                if (data == NULL) {
                    ^~~~
                    StaticString::data
ext/common/StaticString.h:161:14: note: 'StaticString::data' declared here
        const char *data() const {
                    ^
In file included from ext/common/Logging.cpp:31:
In file included from ext/common/Utils/IOUtils.h:39:
ext/common/FileDescriptor.h:177:7: error: call to non-static member function without an object
      argument
                if (data == NULL) {
                    ^~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
rake aborted!
Command failed with status (1): [g++ -Iext -Iext/common -Iext/libev -Wno-ambiguous-member-template -fPIC -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -I/usr/include/apr-1 -I/usr/include/apr-1 -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -DHASH_NAMESPACE="__gnu_cxx" -DHASH_MAP_HEADER="<ext/hash_map>" -DHASH_MAP_CLASS="hash_map" -DHAS_ALLOCA_H -DHAS_SFENCE -DHAS_LFENCE -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -ggdb -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -fcommon -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -o buildout/apache2/module_libpassenger_common/Logging.o -c ext/common/Logging.cpp]
/Library/Ruby/Gems/2.0.0/gems/passenger-4.0.8/build/cplusplus_support.rb:51:in `run_compiler'
/Library/Ruby/Gems/2.0.0/gems/passenger-4.0.8/build/cplusplus_support.rb:61:in `compile_cxx'
/Library/Ruby/Gems/2.0.0/gems/passenger-4.0.8/lib/phusion_passenger/common_library.rb:133:in `block (2 levels) in define_category_tasks'
Tasks: TOP => apache2 => buildout/apache2/mod_passenger.so => buildout/apache2/module_libpassenger_common/Logging.o
(See full trace by running task with --trace)

--------------------------------------------

It looks like something went wrong

Please read our Users guide for troubleshooting tips:

   /Library/Ruby/Gems/2.0.0/gems/passenger-4.0.8/doc/Users guide Apache.html

If that doesn't help, please use our support facilities at:

   https://www.phusionpassenger.com

We'll do our best to help you.

我查看了它所建议的文档,但似乎无法找到可能导致这些错误的内容。我也在网上看了同样的结果。知道是什么原因引起的吗?我该如何解决?

1 个答案:

答案 0 :(得分:2)