尝试将Rails从5.2.0升级到5.2.3的过程比我想象的要困难。在应用程序启动期间,我遇到了Uncaught exception: cannot load such file -- v8
。
如果将mini_racer
替换为therubyracer
,则应用启动,但会抛出ExecJS::RubyRacerRuntime is not supported. Please replace therubyracer with mini_racer in your Gemfile or use Node.js as ExecJS runtime.
我已经安装了nodejs
,而我的Gemfile
是:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.3.3'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.3'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4', '< 0.6.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0', '> 5.0.6'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# 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'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
gem 'cancancan', '~> 2.0'
gem 'devise'
gem 'rack-attack', '~> 5.4.2'
gem 'autoprefixer-rails'
gem 'jquery-rails'
gem 'less-rails-semantic_ui'
gem 'libv8'
gem 'mini_racer'
gem 'faraday'
gem 'mailgun-ruby', '~>1.1.6'
gem 'retriable'
gem 'stripe'
# gem 'prometheus_exporter'
gem 'prometheus-client'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'listen', '>= 3.0.5', '< 3.2'
# Debug on RubyMine
gem 'debase'
gem 'ruby-debug-ide', '0.7.0.beta4'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
end
group :development, :test do
gem 'factory_girl_rails'
gem 'pry'
gem 'rspec-rails'
end
group :test do
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
gem 'database_cleaner'
gem 'rack-test'
end
是我还是JS运行时环境使它看起来很混乱。人们到处都有大量问题,人们需要正确地组合版本,从而使事情正常进行,而实际上并不知道发生了什么。
任何建议都值得欢迎。谢谢。
答案 0 :(得分:0)
这只是尝试: