- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我继承了一个遗留代码库,它要求 Ruby 2.0.0 与 RVM 一起安装。我在 Mac OS X Catalina 上,Ruby 2.0.0 的安装程序根本不起作用。
这是我的安装尝试的样子,从 RVM 本身的安装一直到尝试的 Ruby 2.0.0 安装。
nbyrd$ \curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.10.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.10/1.29.10.tar.gz.asc
gpg: Signature made Wed Mar 25 14:58:42 2020 PDT
gpg: using RSA key 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
gpg: Good signature from "Piotr Kuczynski <piotr.kuczynski@gmail.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 7D2B AF1C F37B 13E2 069D 6956 105B D0E7 3949 9BDB
GPG verified '/Users/nbyrd/.rvm/archives/rvm-1.29.10.tgz'
Installing RVM to /Users/nbyrd/.rvm/
RVM PATH line found in /Users/nbyrd/.mkshrc.
RVM PATH line not found for Bash or Zsh, rerun this command with '--auto-dotfiles' flag to fix it.
RVM sourcing line found in /Users/nbyrd/.profile /Users/nbyrd/.bash_profile /Users/nbyrd/.zlogin.
Installation of RVM in /Users/nbyrd/.rvm/ is almost complete:
* To start using RVM you need to run `source /Users/nbyrd/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.
Thanks for installing RVM 🙏
Please consider donating to our open collective to help us maintain RVM.
👉 Donate: https://opencollective.com/rvm/donate
nbyrd$ source ~/.profile
nbyrd$ rvm autolibs enable
nbyrd$ rvm install 2.0.0 --force
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.0.0-p648.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Installing requirements for osx.
Updating system.......
Installing required packages: openssl.
Updating certificates bundle '/usr/local/etc/openssl@1.1/cert.pem'
Requirements installation successful.
Installing Ruby from source to: /Users/nbyrd/.rvm/rubies/ruby-2.0.0-p648, this may take a while depending on your cpu(s)...
ruby-2.0.0-p648 - #downloading ruby-2.0.0-p648, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 10.2M 100 10.2M 0 0 18.2M 0 --:--:-- --:--:-- --:--:-- 18.2M
ruby-2.0.0-p648 - #extracting ruby-2.0.0-p648 to /Users/nbyrd/.rvm/src/ruby-2.0.0-p648.....
ruby-2.0.0-p648 - #applying patch /Users/nbyrd/.rvm/patches/ruby/2.0.0/openssl3.patch.
ruby-2.0.0-p648 - #applying patch /Users/nbyrd/.rvm/patches/ruby/2.0.0/update-autoconf.patch.
ruby-2.0.0-p648 - #configuring.................................................
ruby-2.0.0-p648 - #post-configuration.
ruby-2.0.0-p648 - #compiling......................
Error running '__rvm_make -j8',
please read /Users/nbyrd/.rvm/log/1605305278_ruby-2.0.0-p648/make.log
There has been an error while running make. Halting the installation.
这是错误消息中引用的“make.log”文件的内容:
[2020-11-13 14:09:14] __rvm_make
__rvm_make ()
{
\make "$@" || return $?
}
current path: /Users/nbyrd/.rvm/src/ruby-2.0.0-p648
PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/sbin:/Users/nbyrd/.yarn/bin:/Users/nbyrd/.config/yarn/global/node_modules/.bin:/usr/local/sbin:/Users/nbyrd/.yarn/bin:/Users/nbyrd/.config/yarn/global/node_modules/.bin:/usr/local/sbin:/Users/nbyrd/.yarn/bin:/Users/nbyrd/.config/yarn/global/node_modules/.bin:/Users/nbyrd/.nvm/versions/node/v10.15.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/nbyrd/.rvm/bin
command(2): __rvm_make -j8
++ make -j8
CC = /usr/bin/clang
LD = ld
LDSHARED = /usr/bin/clang -dynamiclib
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -I. -I.ext/include/x86_64-darwin19.6.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -install_name /Users/nbyrd/.rvm/rubies/ruby-2.0.0-p648/lib/libruby.2.0.0.dylib -current_version 2.0.0 -compatibility_version 2.0.0 -fstack-protector -Wl,-u,_objc_msgSend -fstack-protector -Wl,-u,_objc_msgSend
SOLIBS =
compiling main.c
compiling dmydln.c
compiling dmyencoding.c
compiling version.c
compiling miniprelude.c
translating probes probes.d
compiling bignum.c
compiling class.c
. ./vm_opts.h
compiling compar.c
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling enum.c
complex.c:79:1: warning: unused function 'f_cmp' [-Wunused-function]
f_cmp(VALUE x, VALUE y)
^
complex.c:109:1: warning: unused function 'f_lt_p' [-Wunused-function]
f_lt_p(VALUE x, VALUE y)
^
complex.c:116:1: warning: unused function 'f_mod' [-Wunused-function]
binop(mod, '%')
^
complex.c:30:21: note: expanded from macro 'binop'
inline static VALUE \
^
<scratch space>:89:1: note: expanded from here
f_mod
^
complex.c:155:1: warning: unused function 'f_abs2' [-Wunused-function]
fun1(abs2)
^
complex.c:37:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:92:1: note: expanded from here
f_abs2
^
complex.c:157:1: warning: unused function 'f_conj' [-Wunused-function]
fun1(conj)
^
complex.c:37:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:96:1: note: expanded from here
f_conj
^
complex.c:159:1: warning: unused function 'f_floor' [-Wunused-function]
fun1(floor)
^
complex.c:37:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:100:1: note: expanded from here
f_floor
^
complex.c:160:1: warning: unused function 'f_imag' [-Wunused-function]
fun1(imag)
^
complex.c:37:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:102:1: note: expanded from here
f_imag
^
complex.c:164:1: warning: unused function 'f_real' [-Wunused-function]
fun1(real)
^
complex.c:37:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:110:1: note: expanded from here
f_real
^
complex.c:185:1: warning: unused function 'f_divmod' [-Wunused-function]
fun2(divmod)
^
complex.c:44:21: note: expanded from macro 'fun2'
inline static VALUE \
^
<scratch space>:118:1: note: expanded from here
f_divmod
^
complex.c:197:1: warning: unused function 'f_idiv' [-Wunused-function]
fun2(idiv)
^
complex.c:44:21: note: expanded from macro 'fun2'
inline static VALUE \
^
<scratch space>:124:1: note: expanded from here
f_idiv
^
complex.c:263:1: warning: unused function 'k_integer_p' [-Wunused-function]
k_integer_p(VALUE x)
^
complex.c:465:1: warning: unused function 'f_complex_new1' [-Wunused-function]
f_complex_new1(VALUE klass, VALUE x)
^
complex.c:547:1: warning: unused function 'm_sqrt_bang' [-Wunused-function]
imp1(sqrt)
^
complex.c:518:21: note: expanded from macro 'imp1'
inline static VALUE \
^
<scratch space>:150:1: note: expanded from here
m_sqrt_bang
^
bignum.c:910:1: warning: unused function 'next_pow2' [-Wunused-function]
next_pow2(register unsigned long x)
^
compiling enumerator.c
compiling error.c
compiling eval.c
compiling load.c
compiling proc.c
compiling file.c
compiling gc.c
13 warnings generated.
compiling hash.c
compiling inits.c
compiling io.c
compiling marshal.c
compiling math.c
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling process.c
compiling random.c
compiling range.c
compiling rational.c
rational.c:86:1: warning: unused function 'f_gt_p' [-Wunused-function]
f_gt_p(VALUE x, VALUE y)
^
rational.c:136:1: warning: unused function 'f_floor' [-Wunused-function]
fun1(floor)
^
rational.c:40:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:93:1: note: expanded from here
f_floor
^
rational.c:157:1: warning: unused function 'f_truncate' [-Wunused-function]
fun1(truncate)
^
rational.c:40:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:103:1: note: expanded from here
f_truncate
^
rational.c:428:1: warning: unused function 'f_rational_new_bang2' [-Wunused-function]
f_rational_new_bang2(VALUE klass, VALUE x, VALUE y)
^
rational.c:537:1: warning: unused function 'f_rational_new1' [-Wunused-function]
f_rational_new1(VALUE klass, VALUE x)
^
rational.c:552:1: warning: unused function 'f_rational_new_no_reduce1' [-Wunused-function]
f_rational_new_no_reduce1(VALUE klass, VALUE x)
^
1 warning generated.
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
compiling regsyntax.c
compiling ruby.c
6 warnings generated.
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
compiling strftime.c
compiling string.c
compiling struct.c
compiling time.c
compiling transcode.c
compiling util.c
compiling variable.c
compiling compile.c
compiling debug.c
compiling iseq.c
compiling vm.c
compiling vm_dump.c
compiling vm_backtrace.c
compiling vm_trace.c
compiling thread.c
vm.c:1916:31: warning: expression does not compute the number of elements in this array; element type is 'int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
sizeof(th->machine_regs) / sizeof(VALUE));
~~~~~~~~~~~~~~~~ ^
vm.c:1916:31: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
thread.c:977:27: warning: implicit conversion loses integer precision: 'long' to '__darwin_suseconds_t' (aka 'int') [-Wshorten-64-to-32]
tp->tv_usec = ts.tv_nsec / 1000;
~ ~~~~~~~~~~~^~~~~~
thread.c:4835:20: error: implicit declaration of function 'rb_frame_last_func' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
const ID mid = rb_frame_last_func();
^
thread.c:4835:20: note: did you mean 'rb_frame_this_func'?
./include/ruby/intern.h:369:4: note: 'rb_frame_this_func' declared here
ID rb_frame_this_func(void);
^
1 warning and 1 error generated.
make: *** [thread.o] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.
++ return 2
我真的不知道我能做些什么来克服这个错误。我以前从未使用过 Ruby,但它的源代码中似乎有一个函数调用,但没有函数声明(“rb_frame_last_func”)。
最佳答案
这是由于 Xcode 12 中包含的工具的行为发生了变化:
Clang now reports an error when you use a function without an explicit declaration when building C or Objective-C code for macOS (-Werror=implicit-function-declaration flag is on). This additional error detection unifies Clang’s behavior for iOS/tvOS and macOS 64-bit targets for this diagnostic. (49917738)
export optflags="-Wno-error=implicit-function-declaration"
然后你可以重试:
$ rvm install 2.0.0
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.0.0-p648.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead.
Installing requirements for osx.
Updating system - please wait
Installing required packages: openssl - please wait
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/foo/.rvm/rubies/ruby-2.0.0-p648, this may take a while depending on your cpu(s)...
ruby-2.0.0-p648 - #downloading ruby-2.0.0-p648, this may take a while depending on your connection...
ruby-2.0.0-p648 - #extracting ruby-2.0.0-p648 to /Users/foo/.rvm/src/ruby-2.0.0-p648 - please wait
ruby-2.0.0-p648 - #applying patch /Users/foo/.rvm/patches/ruby/2.0.0/openssl3.patch - please wait
ruby-2.0.0-p648 - #applying patch /Users/foo/.rvm/patches/ruby/2.0.0/update-autoconf.patch - please wait
ruby-2.0.0-p648 - #configuring - please wait
ruby-2.0.0-p648 - #post-configuration - please wait
ruby-2.0.0-p648 - #compiling - please wait
ruby-2.0.0-p648 - #installing - please wait
ruby-2.0.0-p648 - #making binaries executable - please wait
ruby-2.0.0-p648 - #downloading rubygems-3.0.8
ruby-2.0.0-p648 - #extracting rubygems-3.0.8 - please wait
ruby-2.0.0-p648 - #removing old rubygems - please wait
ruby-2.0.0-p648 - #installing rubygems-3.0.8 - please wait
Error running 'env GEM_HOME=/Users/foo/.rvm/gems/ruby-2.0.0-p648@global GEM_PATH= /Users/foo/.rvm/rubies/ruby-2.0.0-p648/bin/ruby -d /Users/foo/.rvm/src/rubygems-3.0.8/setup.rb --no-document',
please read /Users/foo/.rvm/log/1605308161_ruby-2.0.0-p648/rubygems.install.log
尽管最后出现错误,Ruby 确实成功编译和安装:
$ rvm list
ruby-2.0.0-p648 [ x86_64 ]
ruby-2.5.7 [ x86_64 ]
=* ruby-2.7.1 [ x86_64 ]
ruby-3.0.0-preview1 [ x86_64 ]
# => - current
# =* - current && default
# * - default
$ rvm use 2.0.0
rvm use 2.0.0
Using /Users/foo/.rvm/gems/ruby-2.0.0-p648
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-darwin19.6.0]
具有 native 扩展的 gem 可能需要相同的修复:
gem install some_gem_name --with-cflags="-Wno-error=implicit-function-declaration"
或者对于使用捆绑器的应用程序:
bundle config build.some_gem_name --with-cflags=\"-Wno-error=implicit-function-declaration\"
关于ruby - 无法通过 RVM 安装 Ruby 2.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64828816/
以下是一个非常简单的ruby服务器。 require 'socket' local_socket = Socket.new(:INET, :STREAM) local_addr = Socket.
我正在使用 OS X(使用 bash),并且是 unix 的新手。我想知道是否可以修改一些文件以便运行 ruby 程序,我不需要“ruby file.rb”,而是可以运行“ruby.rb”。 有理
我在用 Ruby 替换字符串时遇到一些问题。 我的原文:人之所为不如兽之所为。 我想替换为:==What== human does is not like ==what== animal does.
我想在一个循环中从 Ruby 脚本做这样的事情: 写一个文件a.rb(每次迭代都会改变) 执行系统(ruby 'a.rb') a.rb 将带有结果的字符串写入文件“results” a.rb 完成并且
我的问题是尝试创建一个本地服务器,以便我可以理解由我的新团队开发的应用程序。我的问题是我使用的是 Ruby 2.3.3,而 Gemfile 需要 2.3.1。我无法编辑 Gemfile,因为我被告知很
我有一个使用 GLI 框架用 Ruby 编写的命令行实用程序。我想在我的主目录中配置我的命令行实用程序,使用 Ruby 本身作为 DSL 来处理它(类似于 Gemfile 或 Rakefile)。 我
我的 Rails 应用 Controller 中有这段代码: def delete object = model.datamapper_class.first(:sourced_id =>
我正在寻找的解析器应该: 对 Ruby 解析友好, 规则设计优雅, 产生用户友好的解析错误, 用户文档的数量应该比计算器示例多, UPD:允许在编写语法时省略可选的空格。 快速解析不是一个重要的特性。
我刚开始使用 Ruby,听说有一种“Ruby 方式”编码。除了 Ruby on Rails 之外,还有哪些项目适合学习并被认可且设计良好? 最佳答案 Prawn被明确地创建为不仅是一个该死的好 PDF
我知道之前有人问过类似的问题,但是我该如何构建一个无需在前面输入“ruby”就可以在终端中运行的 Ruby 文件呢? 这里的最终目标是创建一个命令行工具包类型的东西。现在,为了执行我希望用户能够执行的
例如哈希a是{:name=>'mike',:age=>27,:gender=>'male'}哈希 b 是 {:name=>'mike'} 我想知道是否有更好的方法来判断 b 哈希是否在 a 哈希内,而
我是一名决定学习 Ruby 和 Ruby on Rails 的 ASP.NET MVC 开发人员。我已经有所了解并在 RoR 上创建了一个网站。在 ASP.NET MVC 上开发,我一直使用三层架构:
最近我看到 Gary Bernhardt 展示了他用来在 vim 中执行 Ruby 代码的 vim 快捷方式。捷径是 :map ,t :w\|:!ruby %. 似乎这个方法总是执行系统 Rub
在为 this question about Blue Ruby 选择的答案中,查克说: All of the current Ruby implementations are compiled to
我有一个 Ruby 数组 > list = Request.find_all_by_artist("Metallica").map(&:song) => ["Nothing else Matters"
我在四舍五入时遇到问题。我有一个 float ,我想将其四舍五入到小数点后的百分之一。但是,我只能使用 .round ,它基本上将它变成一个 int,意思是 2.34.round # => 2. 有没
我使用 ruby on rails 编写了一个小型 Web 应用程序,它的主要目的是上传、存储和显示来自 xml(文件最多几 MB)文件的结果。运行大约 2 个月后,我注意到 mongrel 进程
我们如何用 Ruby 转换像这样的字符串: 𝑙𝑎𝑡𝑜𝑟𝑟𝑒 收件人: Latorre 最佳答案 s = "𝑙𝑎𝑡𝑜𝑟𝑟𝑒" => "𝑙𝑎𝑡𝑜𝑟𝑟𝑒" s.u
通过 ruby monk 时,他们偶尔会从左侧字段中抛出一段语法不熟悉的代码: def compute(xyz) return nil unless xyz xyz.map {|a,
不确定我做错了什么,但我似乎弄错了。 问题是,给你一串空格分隔的数字,你必须返回最大和最小的数字。 注意:所有数字都是有效的 Int32,不需要验证它们。输入字符串中始终至少有一个数字。输出字符串必须
我是一名优秀的程序员,十分优秀!