Ruby on rails 未初始化的常量ExecJS::Runtimes::RubyRacerRuntime
在我现有的项目中,我改变了Ruby on rails 未初始化的常量ExecJS::Runtimes::RubyRacerRuntime,ruby-on-rails,ruby,therubyracer,execjs,Ruby On Rails,Ruby,Therubyracer,Execjs,在我现有的项目中,我改变了 gem“twitter引导轨道” 到 gem'bootstrap',“~>4.1.3” 在我的档案里。我现在要走了 未初始化的常量ExecJS::Runtimes::RubyRacerRuntime 在线:app/views/layouts.html.erb 档案: source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2
gem“twitter引导轨道”
到
gem'bootstrap',“~>4.1.3”
在我的档案里。我现在要走了
未初始化的常量ExecJS::Runtimes::RubyRacerRuntime
在线:app/views/layouts.html.erb
档案:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.0'
# Use mysql as the database for Active Record
gem 'mysql2'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# 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 'unicorn'
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
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# 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'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15', '< 4.0'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'sidekiq'
gem 'paranoia', '~> 2.2'
gem 'console'
gem 'spreadsheet'
gem 'airbrake', '~> 6.2'
gem 'state_machines'
gem 'state_machines-activerecord'
gem 'devise-i18n'
gem 'devise'
gem 'paper_trail'
gem 'execjs'
gem "therubyracer"
#gem 'sprockets-rails', :require => 'sprockets/railtie'
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
#gem "twitter-bootstrap-rails"
gem 'bootstrap', '~> 4.1.3'
#gem 'bootswatch'
#gem 'jquery-rails'
#gem 'devise-bootstrap-views', '~> 1.0'
#gem "font-awesome-rails"
gem "httparty"
gem "ruby-duration"
gem "jquery-rails"
gem 'webpacker', '~> 3.5'
#gem "spreadsheet"
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '5.2.0'
gem 'activesupport', '5.2.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '1.3.13'
# Use Puma as the app server
gem 'puma', '3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '5.0.7'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '4.1.10'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '4.2.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'execjs', '~> 2.7.0'
gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails', '4.3.3'
# 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.7.0'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '3.1.7'
gem 'passenger', '5.2.3'
# gem 'therubyracer', '0.12.3'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem "simple_calendar", "~> 2.0"
gem 'bootstrap', '~> 4.1.3'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
gem 'rspec-rails', '3.7.2'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '3.6.2'
gem 'listen', '3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', '1.7.2'
gem 'spring-watcher-listen', '2.0.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem列表
:
*** LOCAL GEMS ***
actioncable (5.2.1, 5.2.0)
actionmailer (5.2.1, 5.2.0)
actionpack (5.2.1, 5.2.0)
actionview (5.2.1, 5.2.0)
activejob (5.2.1, 5.2.0)
activemodel (5.2.1, 5.2.0)
activerecord (5.2.1, 5.2.0)
activestorage (5.2.1, 5.2.0)
activesupport (5.2.1, 5.2.0)
addressable (2.5.2)
airbrake (6.3.0)
airbrake-ruby (2.11.0)
archive-zip (0.11.0)
arel (9.0.0)
autoprefixer-rails (9.1.3)
bcrypt (3.1.12)
bigdecimal (default: 1.3.4)
bindex (0.5.0)
bootsnap (1.3.1, 1.3.0)
bootstrap (4.1.3)
bootswatch (4.1.3)
builder (3.2.3)
bundler (1.16.4, default: 1.16.2)
byebug (10.0.2)
capybara (3.7.0, 3.3.1)
childprocess (0.9.0)
chromedriver-helper (1.2.0)
cmath (default: 1.0.0)
coffee-rails (4.2.2)
coffee-script (2.4.1)
coffee-script-source (1.12.2)
commonjs (0.2.7)
concurrent-ruby (1.0.5)
connection_pool (2.2.2)
console (0.5)
crass (1.0.4)
csv (default: 1.0.0)
date (default: 1.0.0)
dbm (default: 1.0.0)
devise (4.5.0, 4.4.3)
devise-bootstrap-views (1.1.0)
devise-i18n (1.6.4)
did_you_mean (1.2.0)
erubi (1.7.1)
etc (default: 1.0.0)
execjs (2.7.0)
fcntl (default: 1.0.0)
ffi (1.9.25)
fiddle (default: 1.0.0)
fileutils (default: 1.0.2)
font-awesome-rails (4.7.0.4)
gdbm (default: 2.0.0)
globalid (0.4.1)
httparty (0.16.2)
i18n (1.1.0, 1.0.1)
io-console (default: 0.4.6)
io-like (0.3.0)
ipaddr (default: 1.2.0)
iso8601 (0.12.0)
jbuilder (2.7.0)
jquery-rails (4.3.3)
json (default: 2.1.0)
kgio (2.11.2)
less (2.6.0)
less-rails (2.8.0)
libv8 (3.16.14.19 x86_64-linux)
listen (3.1.5)
loofah (2.2.2)
mail (2.7.0)
marcel (0.3.2)
method_source (0.9.0)
mimemagic (0.3.2)
mini_mime (1.0.1, 1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3, 5.10.3)
msgpack (1.2.4)
multi_json (1.13.1)
multi_xml (0.6.0)
mysql2 (0.5.2, 0.5.1)
net-telnet (0.1.1)
nio4r (2.3.1)
nokogiri (1.8.4, 1.8.3)
openssl (default: 2.1.0)
orm_adapter (0.5.0)
paper_trail (10.0.1, 9.2.0)
paper_trail-association_tracking (1.0.0)
paranoia (2.4.1)
popper_js (1.14.3)
power_assert (1.1.1)
psych (default: 3.0.2)
public_suffix (3.0.3, 3.0.2)
puma (3.12.0, 3.11.4)
rack (2.0.5)
rack-protection (2.0.3)
rack-proxy (0.6.4)
rack-test (1.1.0, 1.0.0)
rails (5.2.1, 5.2.0)
rails-dom-testing (2.0.3)
rails-html-sanitizer (1.0.4)
railties (5.2.1, 5.2.0)
raindrops (0.19.0)
rake (12.3.1, 12.3.0)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
rdoc (default: 6.0.1)
redis (4.0.2, 4.0.1)
ref (2.0.0)
request_store (1.4.1)
responders (2.4.0)
ruby-duration (3.2.3)
ruby-ole (1.2.12.1)
ruby_dep (1.5.0)
rubygems-update (2.7.7)
rubyzip (1.2.2, 1.2.1)
sass (3.5.7, 3.5.6)
sass-listen (4.0.0)
sass-rails (5.0.7)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
selenium-webdriver (3.14.0, 3.13.0)
sidekiq (5.2.1, 5.1.3)
spreadsheet (1.1.8, 1.1.7)
spring (2.0.2)
spring-watcher-listen (2.0.1)
sprockets (3.7.2)
sprockets-rails (3.2.1)
state_machines (0.5.0)
state_machines-activemodel (0.5.1)
state_machines-activerecord (0.5.1)
stringio (default: 0.0.1)
strscan (default: 1.0.0)
test-unit (3.2.7)
therubyracer (0.12.3)
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
twitter-bootstrap-rails (4.0.0)
tzinfo (1.2.5)
uglifier (4.1.18, 4.1.13)
unicorn (5.4.1, 5.4.0)
warden (1.2.7)
web-console (3.7.0, 3.6.2)
webpacker (3.5.5)
webrick (default: 1.4.2)
websocket-driver (0.7.0)
websocket-extensions (0.1.3)
xmlrpc (0.3.0)
xpath (3.1.0)
zlib (default: 1.0.0)
你知道如何解决这个问题吗?我也有同样的问题,有一个全新的Rails 5.2.0应用程序 当我将引导gem添加到新项目中时,我开始在持续交付构建中看到这个错误。但这并没有影响我的发展。直到我更改了一个.css资产文件。然后我也开始在开发中看到这个错误
ec2-user:~/environment (master) $ rake about
About your application's environment
Rails version 5.2.0
Ruby version 2.4.1-p111 (x86_64-linux)
RubyGems version 2.6.14
Rack version 2.0.5
JavaScript Runtime therubyracer (V8)
Middleware Rack::Sendfile, ActionDispatch::Static, ActionDispatch::Executor, ActiveSupport::Cache::Strategy::LocalCache::Middleware, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, ActionDispatch::RemoteIp, Sprockets::Rails::QuietAssets, Rails::Rack::Logger, ActionDispatch::ShowExceptions, WebConsole::Middleware, ActionDispatch::DebugExceptions, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ContentSecurityPolicy::Middleware, Rack::Head, Rack::ConditionalGet, Rack::ETag, Rack::TempfileReaper
Application root /home/ec2-user/environment
Environment development
Database adapter sqlite3
Database schema version 20180831204125
档案:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.0'
# Use mysql as the database for Active Record
gem 'mysql2'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# 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 'unicorn'
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
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# 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'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15', '< 4.0'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'sidekiq'
gem 'paranoia', '~> 2.2'
gem 'console'
gem 'spreadsheet'
gem 'airbrake', '~> 6.2'
gem 'state_machines'
gem 'state_machines-activerecord'
gem 'devise-i18n'
gem 'devise'
gem 'paper_trail'
gem 'execjs'
gem "therubyracer"
#gem 'sprockets-rails', :require => 'sprockets/railtie'
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
#gem "twitter-bootstrap-rails"
gem 'bootstrap', '~> 4.1.3'
#gem 'bootswatch'
#gem 'jquery-rails'
#gem 'devise-bootstrap-views', '~> 1.0'
#gem "font-awesome-rails"
gem "httparty"
gem "ruby-duration"
gem "jquery-rails"
gem 'webpacker', '~> 3.5'
#gem "spreadsheet"
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '5.2.0'
gem 'activesupport', '5.2.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '1.3.13'
# Use Puma as the app server
gem 'puma', '3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '5.0.7'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '4.1.10'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '4.2.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'execjs', '~> 2.7.0'
gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails', '4.3.3'
# 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.7.0'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '3.1.7'
gem 'passenger', '5.2.3'
# gem 'therubyracer', '0.12.3'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem "simple_calendar", "~> 2.0"
gem 'bootstrap', '~> 4.1.3'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
gem 'rspec-rails', '3.7.2'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '3.6.2'
gem 'listen', '3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', '1.7.2'
gem 'spring-watcher-listen', '2.0.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
我也遇到了同样的问题,用
mini_racer
ranbundle-install
替换了therubyracer
gem,现在正在工作
这个补丁在我的Mac和Ubuntu服务器上对我都有效在更改为使用
bootstrap
后,您是否运行了bundle安装
?我刚开始遇到完全相同的问题,但使用了另一个包,它也使用autoprefixer rails
和less rails
。不确定是哪个gem导致了这个问题。autoprefixer-rails
肯定是这里的问题。根据上面来自barnacle.m的评论,我将autoprefixer-rails升级到今天发布的版本:这并没有解决问题。仍在试验gem版本…我无法通过玩gem版本来修复它。我的最后一个修复方法:我不需要更少,所以我从我的GEM文件中删除了更少的rails。我可以确认这对我也有效。除了我必须从Ruby 2.2.x升级到2.3.x才能使用mini_racer
(这是绝对需要的!)