无法设置开发环境,因为 cppjieba_rb 安装失败

Hi,

I am attempting to setup a development enviroment for Discourse.

When running bundle install based on the instructions at Beginners Guide to Install Discourse on macOS for Development I get an error.

An error occurred while installing cppjieba_rb (0.3.0), and Bundler
cannot continue.
Make sure that `gem install cppjieba_rb -v '0.3.0' --source
'https://rubygems.org/'` succeeds before bundling.

I follow the suggestion and get the following output

$ gem install cppjieba_rb -v '0.3.0' --source
ERROR:  While executing gem ... (OptionParser::MissingArgument)
    missing argument: --source

What am I doing wrong and how can I fix the issue?

Can you try the docker based dev env, it is way simpler

I just checked my system and realized some dependencies and the ruby version manager thing needed to be configured . That might be while bundler is installing.

That said Docker does sound simpler, I intend to submit pull requests to Discourse, is the Docker environment still right for me? If so could you link me to information on it? Thanks :heart:

Yes it is perfect for that, search for docker development environment, there is a howto

1 个赞

The only thing I could find was Setting up Docker in Virtualbox for 'production' testing which looks terribly outdated considering it’s use of Ubuntu 13. Could you link me to exactly the thread you’re talking about?

Sam’s talking about this one: Beginners Guide to Install Discourse for Development using Docker

4 个赞

Thanks, and turns out - since I tried to install while on system Ruby rather than the correct version, future bundle installs were trying to use system rather than correct bundler. Deleting discourse and recloning solved the issue.


And I can now start making changes and creating new bugs :smiley:

5 个赞

Im getting the same error. I am running ubuntu on vagrant. Any know how to get passed this? @sam

Vagrant is not a supported dev environment, please follow one of the supported Developer Environment guides:

4 个赞

我也遇到了这个问题。想搭建一个本地 Discourse 环境来测试这个软件,没想到这么难,真让人沮丧。

具体是哪个问题?能否说得更详细一些?

I can’t seem to get the environment to set up correctly due to this cppjieba_rb library

Tried to fix by: sudo gem install cppjieba_rb -v '0.3.3' --source 'https://rubygems.org/'

Here was it’s output:

ERROR:  Error installing cppjieba_rb:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200402-46278-1lzwumr.rb extconf.rb
creating Makefile

current directory: /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb
make "DESTDIR="
compiling cppjieba_rb.c
compiling internal.cc
In file included from internal.cc:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby.h:33:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:24:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19/ruby/config.h:413:31: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
#define RUBY_ARCH "universal-"RUBY_PLATFORM_OS
                              ^
                               
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19/ruby/config.h:414:35: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
#define RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
                                  ^
                                   
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19/ruby/config.h:414:55: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
#define RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
                                                      ^
                                                       
In file included from internal.cc:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby.h:33:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:2111:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/intern.h:56:19: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                  ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/intern.h:56:36: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                                   ^~~~~~~~~
In file included from internal.cc:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/Jieba.hpp:4:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/QuerySegment.hpp:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/DictTrie.hpp:13:
/Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/deps/limonp/StringUtil.hpp:87:70: warning: 'ptr_fun<unsigned int, bool>' is deprecated [-Wdeprecated-declarations]
  s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<unsigned, bool>(IsSpace))));
                                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1097:1: note: 'ptr_fun<unsigned int, bool>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
In file included from internal.cc:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/Jieba.hpp:4:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/QuerySegment.hpp:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/DictTrie.hpp:13:
/Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/deps/limonp/StringUtil.hpp:92:61: warning: 'ptr_fun<unsigned int, bool>' is deprecated [-Wdeprecated-declarations]
  s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<unsigned, bool>(IsSpace))).base(), s.end());
                                                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1097:1: note: 'ptr_fun<unsigned int, bool>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
In file included from internal.cc:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/Jieba.hpp:4:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/QuerySegment.hpp:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/DictTrie.hpp:13:
/Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/deps/limonp/StringUtil.hpp:101:70: warning: 'bind2nd<std::__1::equal_to<char>, char>' is deprecated [-Wdeprecated-declarations]
  s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::bind2nd(std::equal_to<char>(), x))));
                                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1079:1: note: 'bind2nd<std::__1::equal_to<char>, char>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
In file included from internal.cc:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/Jieba.hpp:4:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/QuerySegment.hpp:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/DictTrie.hpp:13:
/Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/deps/limonp/StringUtil.hpp:106:61: warning: 'bind2nd<std::__1::equal_to<char>, char>' is deprecated [-Wdeprecated-declarations]
  s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::bind2nd(std::equal_to<char>(), x))).base(), s.end());
                                                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1079:1: note: 'bind2nd<std::__1::equal_to<char>, char>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
6 warnings and 3 errors generated.
make: *** [internal.o] Error 1

make failed, exit code 2

好的,所以你运行了脚本,克隆了仓库,但在 bundle install 时出错了?

您使用的是哪个版本的 macOS?

FWIW: I have this same issue on MacOS:

$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Using rake 13.0.1
Using concurrent-ruby 1.1.6
Using i18n 1.8.2
Using minitest 5.14.0
Using thread_safe 0.3.6
Using tzinfo 1.2.7
Using zeitwerk 2.3.0
Using activesupport 6.0.1
Using builder 3.2.4
Using erubi 1.9.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.9
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.5.0
Using rails-html-sanitizer 1.3.0
Using actionview 6.0.1
Using rack 2.0.8
Using rack-test 1.1.0
Using actionpack 6.0.1
Using globalid 0.4.2
Using activejob 6.0.1
Using mini_mime 1.0.2
Using mail 2.7.1
Using actionmailer 6.0.1
Using actionview_precompiler 0.2.2
Using activemodel 6.0.1
Using active_model_serializers 0.8.4
Using activerecord 6.0.1
Using public_suffix 4.0.4
Using addressable 2.7.0
Using annotate 3.1.1
Using ast 2.4.0
Using aws-eventstream 1.0.3
Using aws-partitions 1.294.0
Using aws-sigv4 1.1.1
Using jmespath 1.4.0
Using aws-sdk-core 3.92.0
Using aws-sdk-kms 1.30.0
Using aws-sdk-s3 1.61.2
Using aws-sdk-sns 1.22.0
Using ember-source 2.18.2
Using execjs 2.7.0
Using barber 0.12.2
Using coderay 1.1.2
Using better_errors 2.6.0
Using debug_inspector 0.0.3
Using binding_of_caller 0.8.0
Using msgpack 1.3.3
Using bootsnap 1.4.6
Using uniform_notifier 1.13.0
Using bullet 6.1.0
Using bundler 2.1.4
Using byebug 11.1.1
Using cbor 0.5.9.6
Using certified 1.0.0
Using chunky_png 1.3.11
Using colored2 3.1.2
Using connection_pool 2.2.2
Using openssl-signature_algorithm 0.4.0
Using cose 1.0.0
Fetching cppjieba_rb 0.3.3
Installing cppjieba_rb 0.3.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20200407-43449-1j9kfa1.rb extconf.rb
creating Makefile

current directory: /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb
make "DESTDIR="
compiling cppjieba_rb.c
compiling internal.cc
In file included from internal.cc:1:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby.h:33:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:24:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19/ruby/config.h:413:31:
error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
#define RUBY_ARCH "universal-"RUBY_PLATFORM_OS
                              ^
                               
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19/ruby/config.h:414:35:
error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
#define RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
                                  ^
                                   
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19/ruby/config.h:414:55:
error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
#define RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
                                                      ^
                                                       
In file included from internal.cc:1:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby.h:33:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:2111:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/intern.h:56:19:
warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                  ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/intern.h:56:36:
warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                                   ^~~~~~~~~
In file included from internal.cc:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/Jieba.hpp:4:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/QuerySegment.hpp:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/DictTrie.hpp:13:
/Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/deps/limonp/StringUtil.hpp:87:70: warning: 'ptr_fun<unsigned int, bool>' is deprecated
[-Wdeprecated-declarations]
  s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<unsigned, bool>(IsSpace))));
                                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1100:1: note: 'ptr_fun<unsigned int, bool>' has been explicitly
marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1054:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1043:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
In file included from internal.cc:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/Jieba.hpp:4:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/QuerySegment.hpp:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/DictTrie.hpp:13:
/Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/deps/limonp/StringUtil.hpp:92:61: warning: 'ptr_fun<unsigned int, bool>' is deprecated
[-Wdeprecated-declarations]
  s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<unsigned, bool>(IsSpace))).base(), s.end());
                                                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1100:1: note: 'ptr_fun<unsigned int, bool>' has been explicitly
marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1054:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1043:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
In file included from internal.cc:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/Jieba.hpp:4:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/QuerySegment.hpp:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/DictTrie.hpp:13:
/Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/deps/limonp/StringUtil.hpp:101:70: warning: 'bind2nd<std::__1::equal_to<char>, char>' is deprecated
[-Wdeprecated-declarations]
  s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::bind2nd(std::equal_to<char>(), x))));
                                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1082:1: note: 'bind2nd<std::__1::equal_to<char>, char>' has been
explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1054:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1043:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
In file included from internal.cc:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/Jieba.hpp:4:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/QuerySegment.hpp:8:
In file included from /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/DictTrie.hpp:13:
/Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/deps/limonp/StringUtil.hpp:106:61: warning: 'bind2nd<std::__1::equal_to<char>, char>' is deprecated
[-Wdeprecated-declarations]
  s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::bind2nd(std::equal_to<char>(), x))).base(), s.end());
                                                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1082:1: note: 'bind2nd<std::__1::equal_to<char>, char>' has been
explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1054:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1043:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
6 warnings and 3 errors generated.
make: *** [internal.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/cppjieba_rb-0.3.3/gem_make.out

An error occurred while installing cppjieba_rb (0.3.3), and Bundler cannot continue.
Make sure that `gem install cppjieba_rb -v '0.3.3' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  cppjieba_rb

FYI: Xcode version info:

The Google God has yielded no solutions or fruit. There was tangential GitHub issue which suggested:

Try running gem install rake and then running bundler again. If that doesn’t work, there are a few other solutions listed in the above post.

.. however, this yielded nor any fruit and the error remains even if I start the cloning process from scratch again.

更新:

此问题似乎已通过相关解决方案解决:TLDR:不要使用 macOS 自带的 Ruby。

参见:xavi-2019 年 5 月 16 日 发表的评论。

我按照他的(xavi 的)说明操作,切换到 rbenv 后,bundle install 成功执行,但仍需进一步确认……

更新 2:

已确认: 切换到 rbenv 并配置当前的 PATH 环境变量 ~/.rbenv/shims 可以解决问题。

export PATH=~/.rbenv/shims:$PATH
5 个赞

我一直被这个错误困扰,而你建议的方法(将 rbenv 添加到 PATH)对我奏效了。

非常感谢。

3 个赞