找不到 Ruby on Rails 符号

Posted

技术标签:

【中文标题】找不到 Ruby on Rails 符号【英文标题】:Ruby on Rails Symbol not found 【发布时间】:2021-11-01 10:18:30 【问题描述】:

我有以下错误;当我在渲染时运行应用程序时会发生这种情况

unknown@mini Project.V1 % bundle exec rails s
DEPRECATION WARNING: axlsx_rails has been renamed to caxlsx_rails. See http://github.com/caxlsx
=> Booting Puma
=> Rails 5.0.7.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.2 (ruby 2.4.1-p111), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
Started GET "/users/sign_in" for ::1 at 2021-09-02 20:47:51 -0500
Processing by SessionsController#new as html
  Rendering devise/sessions/new.haml within layouts/login
dyld: lazy symbol binding failed: Symbol not found: __ZN2v82V813InitializeICUEPKc
  Referenced from: /Users/unknown/.asdf/installs/ruby/2.4.1/lib/ruby/gems/2.4.0/gems/mini_racer-0.2.9/lib/mini_racer_extension.bundle
  Expected in: flat namespace

dyld: Symbol not found: __ZN2v82V813InitializeICUEPKc
  Referenced from: /Users/unknown/.asdf/installs/ruby/2.4.1/lib/ruby/gems/2.4.0/gems/mini_racer-0.2.9/lib/mini_racer_extension.bundle
  Expected in: flat namespace

zsh: abort      bundle exec rails s

这只发生在从服务器渲染视图时;以下是操作系统和硬件的详细信息 (Mac Mini M1)

操作系统

unknown@mini Project.V1 % ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [-darwin20]

unknown@mini Project.V1 % rails --version
Rails 5.0.7.2

unknown@mini Project.V1 % sw_vers        
ProductName:    macOS
ProductVersion: 11.5.2
BuildVersion:   20G95

unknown@mini Project.V1 % uname          
Darwin

欢迎任何帮助或想法,谢谢

【问题讨论】:

【参考方案1】:

这个问题似乎已经在 mini_racer 上报告过 - 参考:https://github.com/rubyjs/mini_racer/issues/185

尝试线程中提到的解决方案 - here

# Gemfile
gem 'mini_racer', github: 'rubyjs/mini_racer', branch: 'refs/pull/186/head'
# or
gem 'mini_racer', github: 'sqreen/mini_racer', branch: 'use-libv8-node'

试试以下版本的 mini_racer

gem 'mini_racer', '~> 0.4.0'

【讨论】:

以上是关于找不到 Ruby on Rails 符号的主要内容,如果未能解决你的问题,请参考以下文章

[Ruby on Rails] 找不到类型为“application/javascript”的文件“jquery-ui/autocomplete”

找不到或无法读取要导入的文件:在 ruby​​ on rails 项目中使用 tailwind 框架的 bootstrap-datetimepicker

运行 Rails 服务器时出错 - 找不到符号 - therubyracer

Rails:找不到 gem 'sdoc (>=0) ruby​​'

每当Rails cron,捆绑:找不到命令

Rails 服务器说找不到图像