ruby-on-rails - RAILS_ENV=production rails assets:precompile - ruby_racer_runtime.rb:73: 分段错误
问题描述
当我运行 RAILS_ENV=production bundle exec rake assets:precompile --trace 时,它返回以下错误
** 执行资产:预编译 .rvm/gems/ruby-2.4.1@rails5/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:73:[BUG] 分段错误在 0x00000000000018 ruby 2.4.1p111 (2017 -03-22 修订版 58053) [x86_64-linux]
以下是环境细节
ruby 版本:ruby-2.4.1 Rails 版本:5.1.7 发行商 ID:Ubuntu 描述:Ubuntu 18.04.2 LTS 版本:18.04 代号:bionic
我的宝石文件
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.7'
gem 'execjs'
gem 'therubyracer', :platforms => :ruby
gem 'mysql2'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
在我安装 ruby 2.5.5 之后。以下是我的 Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'rails', '~> 5.2.3'
gem 'mysql2'
gem 'therubyracer', platforms: :ruby
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
解决方案
推荐阅读
- javascript - 无法读取未定义的属性“setState” - 进度条
- c++ - ETW:调用 TdhGetEventInformation 时出现访问冲突错误
- ubuntu - 安装 NFS 服务器的问题:服务器端 MacOS、客户端 SAMA5D27 板
- r - 错误:EmailException (Java):将电子邮件发送到以下服务器失败:smtp.office365.com:587。R
- r - 如何在 R 数据框中满足条件后的第二天有条件地删除数据值?
- reactjs - Material-UI & React:使用 Fade 组件 onScroll
- c# - 计算列表中自己结构的重复项
- python - Python:将一维数组(具有等面积坐标系)转换为二维数组(具有地理坐标参考系)
- javascript - Javascript - 切片对象数组
- saml-2.0 - SAML 2.0 - 身份验证问题即时太旧或未来