¿Cuál es el enfoque y la opinión actual sobre la instalación de Discourse en macOS con fines de desarrollo? He intentado instalarlo siguiendo las instrucciones oficiales documentadas en GitHub en el artículo Guía para principiantes para instalar Discourse en macOS para desarrollo, pero no funciona.
Se reportan 3 errores al intentar instalar el gem cppjieba_rb-0.3.3.
~/Developer/localhost/discourse en master sudo gem install cppjieba_rb -v '0.3.3' --source 'https://rubygems.org/' a las 17:13:33
Contraseña:
Construyendo extensiones nativas. Esto puede tardar un poco...
ERROR: Error al instalar cppjieba_rb:
ERROR: Falló la compilación de la extensión nativa del gem.
directorio actual: /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 ./siteconf20191021-73798-k500fk.rb extconf.rb
creando Makefile
directorio actual: /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb
make "DESTDIR=" clean
directorio actual: /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb
make "DESTDIR="
compilando cppjieba_rb.c
compilando internal.cc
En el archivo incluido desde internal.cc:1:
En el archivo incluido desde /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:
En el archivo incluido desde /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: sufijo no válido en literal; C++11 requiere un espacio entre el literal y el identificador [-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: sufijo no válido en literal; C++11 requiere un espacio entre el literal y el identificador [-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: sufijo no válido en literal; C++11 requiere un espacio entre el literal y el identificador [-Wreserved-user-defined-literal]
#define RUBY_PLATFORM "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
^
En el archivo incluido desde internal.cc:1:
En el archivo incluido desde /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:
En el archivo incluido desde /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: advertencia: el especificador de almacenamiento 'register' está obsoleto e incompatible con 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: advertencia: el especificador de almacenamiento 'register' está obsoleto e incompatible con C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
^~~~~~~~~
En el archivo incluido desde internal.cc:8:
En el archivo incluido desde /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/Jieba.hpp:4:
En el archivo incluido desde /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/QuerySegment.hpp:8:
En el archivo incluido desde /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: advertencia: 'ptr_fun<unsigned int, bool>' está obsoleto [-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: nota: 'ptr_fun<unsigned int, bool>' ha sido marcado explícitamente como obsoleto aquí
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: nota: expandido desde la 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: nota: expandido desde la macro '_LIBCPP_DEPRECATED'
# define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
^
En el archivo incluido desde internal.cc:8:
En el archivo incluido desde /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/Jieba.hpp:4:
En el archivo incluido desde /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/QuerySegment.hpp:8:
En el archivo incluido desde /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: advertencia: 'ptr_fun<unsigned int, bool>' está obsoleto [-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: nota: 'ptr_fun<unsigned int, bool>' ha sido marcado explícitamente como obsoleto aquí
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: nota: expandido desde la 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: nota: expandido desde la macro '_LIBCPP_DEPRECATED'
# define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
^
En el archivo incluido desde internal.cc:8:
En el archivo incluido desde /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/Jieba.hpp:4:
En el archivo incluido desde /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/QuerySegment.hpp:8:
En el archivo incluido desde /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: advertencia: 'bind2nd<std::__1::equal_to<char>, char>' está obsoleto [-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: nota: 'bind2nd<std::__1::equal_to<char>, char>' ha sido marcado explícitamente como obsoleto aquí
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: nota: expandido desde la 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: nota: expandido desde la macro '_LIBCPP_DEPRECATED'
# define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
^
En el archivo incluido desde internal.cc:8:
En el archivo incluido desde /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/Jieba.hpp:4:
En el archivo incluido desde /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3/ext/cppjieba_rb/../cppjieba/include/cppjieba/QuerySegment.hpp:8:
En el archivo incluido desde /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: advertencia: 'bind2nd<std::__1::equal_to<char>, char>' está obsoleto [-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: nota: 'bind2nd<std::__1::equal_to<char>, char>' ha sido marcado explícitamente como obsoleto aquí
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: nota: expandido desde la 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: nota: expandido desde la macro '_LIBCPP_DEPRECATED'
# define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
^
6 advertencias y 3 errores generados.
make: *** [internal.o] Error 1
make falló, código de salida 2
Los archivos del gem permanecerán instalados en /Library/Ruby/Gems/2.6.0/gems/cppjieba_rb-0.3.3 para su inspección.
Los resultados se registraron en /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/cppjieba_rb-0.3.3/gem_make.out
No lo logré averiguar. ¿Hiciste algo más que solo instalar rbenv como parte del script de instalación de dependencias de Discourse? Eso es todo lo que hice, ya que no hay más instrucciones.
Mi entorno de desarrollo se configuró hace mucho tiempo, así que no estoy seguro. No creo que haya hecho nada más en ese momento, pero quizás algo haya cambiado en macOS desde entonces.
Supongo que puedes verificar si rbenv está configurado… si ejecutas nano ~/.bash_profile, deberías ver algo como esto:
También puedes verificar rbenv versions para ver qué versión está seleccionada actualmente (es la que tiene un asterisco al lado). Si es system, querrás cambiarla… 2.6.1 funciona bien para mí. (rbenv install 2.6.1 y luego rbenv global 2.6.1)