Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninitialized constant ExecJS::Runtimes::RubyRacerRuntime #80

Closed
Dvelezs94 opened this issue Aug 24, 2018 · 7 comments
Closed

uninitialized constant ExecJS::Runtimes::RubyRacerRuntime #80

Dvelezs94 opened this issue Aug 24, 2018 · 7 comments

Comments

@Dvelezs94
Copy link

Dvelezs94 commented Aug 24, 2018

Hello, Im having an issue on Rails 5 where suddenly im getting this error (the app worked yesterday). here is my app info

root@144a09c0de36:/app# rails version
Rails 5.2.1
root@144a09c0de36:/app# node -v
v8.11.4
root@144a09c0de36:/app# gem query --local

*** LOCAL GEMS ***

actioncable (5.2.1)
actionmailer (5.2.1)
actionpack (5.2.1)
actionview (5.2.1)
activejob (5.2.1)
activemodel (5.2.1)
activerecord (5.2.1)
activestorage (5.2.1)
activesupport (5.2.1)
arel (9.0.0)
autoprefixer-rails (9.1.3)
bigdecimal (default: 1.3.4)
bindex (0.5.0)
bootsnap (1.3.1)
bootstrap (4.1.3)
builder (3.2.3)
bundler (1.16.3, default: 1.16.2)
byebug (10.0.2)
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)
crass (1.0.4)
csv (default: 1.0.0)
date (default: 1.0.0)
dbm (default: 1.0.0)
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)
i18n (1.1.0)
io-console (default: 0.4.6)
ipaddr (default: 1.2.0)
jbuilder (2.7.0)
jquery-rails (4.3.3)
json (default: 2.1.0)
less (2.6.0)
less-rails (2.8.0)
less-rails-bootstrap (3.3.5.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)
mini_portile2 (2.3.0)
minitest (5.11.3, 5.10.3)
msgpack (1.2.4)
multi_json (1.13.1)
net-telnet (0.1.1)
nio4r (2.3.1)
nokogiri (1.8.4)
openssl (default: 2.1.0)
pg (1.0.0)
popper_js (1.14.3)
power_assert (1.1.1)
psych (default: 3.0.2)
puma (3.12.0)
rack (2.0.5)
rack-test (1.1.0)
rails (5.2.1)
rails-dom-testing (2.0.3)
rails-html-sanitizer (1.0.4)
railties (5.2.1)
rake (12.3.1, 12.3.0)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
rdoc (default: 6.0.1)
ref (2.0.0)
ruby_dep (1.5.0)
rubygems-update (2.7.7)
sass (3.5.7)
sass-listen (4.0.0)
sass-rails (5.0.7)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
spring (2.0.2)
spring-watcher-listen (2.0.1)
sprockets (3.7.2)
sprockets-rails (3.2.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)
turbolinks (5.2.0)
turbolinks-source (5.2.0)
tzinfo (1.2.5)
uglifier (4.1.18)
web-console (3.6.2)
webrick (default: 1.4.2)
websocket-driver (0.7.0)
websocket-extensions (0.1.3)
xmlrpc (0.3.0)
zlib (default: 1.0.0)

I have both of these in my Gemfile

gem 'execjs'
gem 'therubyracer'

Here is my Dockerfile

FROM ruby:2.5
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev curl software-properties-common
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt install -y nodejs
RUN mkdir /app
WORKDIR /app
COPY . .
RUN bundle install
RUN rm -f tmp/pids/server.pid
CMD bundle exec rails s -p 3000 -b '0.0.0.0'
@rafaelfranca
Copy link
Member

Can you please provide a sample application that reproduces the error?

@Dvelezs94
Copy link
Author

@rafaelfranca the piece of code i want to run is this

app_1      | ActionView::Template::Error (uninitialized constant ExecJS::Runtimes::RubyRacerRuntime):
app_1      |     70:     <div class="container-fluid p-0">
app_1      |     71:     <div class="row no-gutters">
app_1      |     72:
app_1      |     73:         <div class="col-lg-6 order-lg-2 text-white showcase-img" style="background-image: url(<%= asset_path('bg-showcase-1.jpg') %>);"></div>
app_1      |     74:         <div class="col-lg-6 order-lg-1 my-auto showcase-text">
app_1      |     75:         <h2>Fully Responsive Design</h2>
app_1      |     76:         <p class="lead mb-0">When you use a theme created by Start Bootstrap, you know that the theme will look great on any device, whether it's a phone, tablet, or desktop the page will behave responsively!</p>
app_1      |
app_1      | app/views/pages/index.html.erb:73:in `_app_views_pages_index_html_erb__1509257406324096851_47129302344520'

@rafaelfranca
Copy link
Member

Right, but with no way to reproduce we can't do anything, this is why I'm asking an new application that reproduces this error. Maybe the problem is in your code.

@Dvelezs94
Copy link
Author

Dvelezs94 commented Aug 24, 2018

@rafaelfranca Ive created this repo with a sample app where the issue is the same. https://github.com/Dvelezs94/racerissue . I also included a helper script so u can follow the same steps im doing (on the readme)

Prerequisites:

  • Docker
  • Docker-compose

Steps:
1.- start
2.- create db
3.- visit localhost (you should see the error here)

Thanks in Advance!

@rafaelfranca
Copy link
Member

This is a bug in autoprefixer-rails ai/autoprefixer-rails@e572cb7. This runtime that it is looking for doesn't exist. It is ExecJS::RubyRacerRuntime.

@Dvelezs94
Copy link
Author

@rafaelfranca Thank you! that was the issue

So for the people that has this issue.
Replace gem 'therubyracer' for gem 'mini_racer', platforms: :ruby

@rafaelfranca
Copy link
Member

That is not the fix. We need to report the bug to autoprefixer-rails their code is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants