我的是 macbook pro2017 款的,版本 10.14.3
项目比较老,用的 rails3.2,我本地安装的 rvm 都是 2.4+ 的,我先用 ruby2.4.4 版本 bundle install 项目,可以正确执行
rails -v
,显示 ruby 的版本版本
但是bundle exec rails s
会提示错误
/Users/jieyi/.rvm/gems/ruby-2.4.4/gems/rubysl-rexml-2.0.4/lib/rexml/text.rb:35: warning: constant ::Fixnum is deprecated
/Users/jieyi/.rvm/gems/ruby-2.4.4/gems/rubysl-rexml-2.0.4/lib/rexml/xpath_parser.rb:19: warning: constant ::Fixnum is deprecated
/Users/jieyi/.rvm/gems/ruby-2.4.4/gems/CFPropertyList-2.3.1/lib/cfpropertylist/rbCFTypes.rb:24: warning: constant ::Fixnum is deprecated
/Users/jieyi/.rvm/gems/ruby-2.4.4/gems/activesupport-3.2.22.5/lib/active_support/core_ext/numeric/time.rb:50:in `*': ActiveSupport::Duration can't be coerced into Integer (TypeError)
我 google 一圈,试了很多,还是会提示这个错误,后来有人说 ruby 版本需要控制在 2.3,我本地就开始安装 ruby 2.3.3
rvm install 2.3.3,无法正常安装成功会报错,报错如下
Warning, new version of rvm available '1.29.12', you are using older version '1.29.11'.
You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
You can update manually with: rvm get VERSION (e.g. 'rvm get stable')
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.14/x86_64/ruby-2.3.3.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Installing requirements for osx.
Updating system - please wait
Failed to update Homebrew, follow instructions at
https://docs.brew.sh/Common-Issues
and make sure `brew update` works before continuing.
Error running 'requirements_osx_brew_update_system ruby-2.3.3',
please read /Users/jieyi/.rvm/log/1692713412_ruby-2.3.3/update_system.log
Requirements installation failed with status: 1.
我用
PKG_CONFIG_PATH=/usr/local/Cellar/[email protected] \
rvm install 2.3.3 \
--with-openssl-dir=/usr/local/Cellar/[email protected] \
--with-openssl-lib=/usr/local/Cellar/[email protected] \
--with-openssl-include=/usr/local/Cellar/[email protected]
会安装成功,但是错误日志会提示rvm install 2.3.3 cannot load such file -- openssl
折腾了一天,没有折腾出来,我想请教下社区大佬,我是安装好低版本问题就好了吗,还是需要解决ActiveSupport::Duration can't be coerced into Integer
问题,另外,我的电脑版本可以安装低版本了,为什么我无法关联 openssl 呢,谢谢🙏