无法安装旧红宝石版本

发布于 2025-01-28 00:53:47 字数 2820 浏览 2 评论 0 原文

我无法安装Ruby 2.4.2

我的设置必须允许我使用 nvm rvm ,我需要使用Ruby版本 2.7.2 2.4.2 。我怀疑您可能会发现我的 openssl rvm 设置的多个问题。另外,我不确定哪个版本的 openssl 适合我。我正在使用 MacOS Monterey 版本 12.3.1

当我这样做时:

  RVM安装2.4.2
 

我在... ruby​​-2.4.2/configure.log中看到此错误

配置:错误:有问题 ldflags =“ - l/opt/homebrew/opt/ /lib“

以下信息可能与问题有关:

openssl版本#libressl 2.8.3

/.zshrc〜

export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH="/opt/homebrew/bin:$PATH"
export PATH="/opt/homebrew/sbin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include"
export ZSH="$HOME/.oh-my-zsh"
HIST_STAMPS="dd/mm/yyyy"
plugins=(git)
source $ZSH/oh-my-zsh.sh
export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include"
export RUBY_CFLAGS="-DUSE_FFI_CLOSURE_ALLOC"

/.bashrc〜

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" 
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  
export PATH="$PATH:$HOME/.rvm/bin"

/.bash_profile

PATH="~/.rvm/gems/ruby-2.7.2/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin/sqlite3:$PATH"
export NVM_DIR=~/.nvm

source ~/.bashrc

# Disabled the next line
# source ~/.profile

alias start_puma="bundle exec puma -p 3000 -S ~/puma -C config/puma.rb"

parse_git_branch() {
  git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}
setopt PROMPT_SUBST
export PROMPT='%F{grey}%n%f %F{cyan}%~%f %F{green}$(parse_git_branch)%f %F{normal}$%f '

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

I am unable to install ruby 2.4.2

My setup must allow me to use nvm and rvm, and I need to use ruby versions 2.7.2 and 2.4.2. I suspect you may find multiple problems with my openssl and rvm setup. Also, I am not sure which version of openssl is appropriate for me. I am using macOS Monterey Version 12.3.1.

When I do:

  rvm install 2.4.2

I see this error in my ..._ruby-2.4.2/configure.log

configure: error: something wrong with
LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"

The following info may relate to the problem:

openssl version # LibreSSL 2.8.3

~/.zshrc

export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH="/opt/homebrew/bin:$PATH"
export PATH="/opt/homebrew/sbin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include"
export ZSH="$HOME/.oh-my-zsh"
HIST_STAMPS="dd/mm/yyyy"
plugins=(git)
source $ZSH/oh-my-zsh.sh
export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include"
export RUBY_CFLAGS="-DUSE_FFI_CLOSURE_ALLOC"

~/.bashrc

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" 
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  
export PATH="$PATH:$HOME/.rvm/bin"

~/.bash_profile

PATH="~/.rvm/gems/ruby-2.7.2/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin/sqlite3:$PATH"
export NVM_DIR=~/.nvm

source ~/.bashrc

# Disabled the next line
# source ~/.profile

alias start_puma="bundle exec puma -p 3000 -S ~/puma -C config/puma.rb"

parse_git_branch() {
  git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}
setopt PROMPT_SUBST
export PROMPT='%F{grey}%n%f %F{cyan}%~%f %F{green}$(parse_git_branch)%f %F{normal}$%f '

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

宛菡 2025-02-04 00:53:47

我确定了两个问题:

  1. 我的ldflags在〜/.zshrc中的路径错误,
  2. 我不明白为什么 openssl版本生产 libressl 2.8.3

我找到了通往<<<<的正确路径代码> ldflags 在 brew renstall产生的错误中] 。错误包括:

供编译器查找
导出ldflags =“ - l/usr/local/opt/
>/lib“
导出cppflags =“ - i/usr/local/opt/
/包括“


openssl版本的响应仍然是 libressl 2.8.3 ,我认为这是正确的。

我还了解到〜/.zshrc 必须包括 source〜/.bash_profile ,并且该〜/.bash_profile 必须包括 source> source> source> 〜/.bashrc

我现在能够打开一个新的shell窗口,并查看 rvm list (列出可用的Ruby版本)的正确结果(列出 nvm list list (列出了可用节点版本)。

我还可以安装我想要的红宝石版本。

I identified two problems:

  1. My LDFLAGS had the wrong path in ~/.zshrc
  2. I did not understand why openssl version produced LibreSSL 2.8.3

I found the correct path to the LDFLAGS within the errors produced by brew reinstall [email protected]. The errors included:

For compilers to find [email protected] you may need to set:
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

The response to openssl version is still LibreSSL 2.8.3 and I assume this is correct.

I have also learned that ~/.zshrc must include source ~/.bash_profile, and that ~/.bash_profile must include source ~/.bashrc.

I am now able to open a new shell window and see the correct results for rvm list (listing the available ruby versions) and nvm list (listing the available node versions).

I am also able to install the ruby versions I want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文