Error Installing rails on Vagrant

Asked 2 years ago, Updated 2 years ago, 104 views

Installing rails on Vagrant or creating memo program results in an error and cannot be displayed initially.
rails 5.1.6centOS 6.8

ExecJS::RuntimeError in Memos#index
Showing/home/vagrant/rails_lessons/note/app/views/layouts/application.html.erb where line#6 raised:
node: /usr/lib64/libstdc++.so.6: version`GLIBCXX_3.4.14' not found (required by node)
node: /usr/lib64/libstdc++.so.6: version`GLIBCXX_3.4.18' not found (required by node)
node: /usr/lib64/libstdc++.so.6: version`CXXABI_1.3.5' not found (required by node)
node: /usr/lib64/libstdc++.so.6: version`GLIBCXX_3.4.15' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.16' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by node)
Rails.root: /home/vagrant/rails_lessons/note

application.html.erb

<html>
  <head>
    <title> Note> /title>
    <%=csrf_meta_tags%>

    <%=stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'%>
    <%=javascript_include_tag 'application', 'data-turbolinks-track': 'reload'%>
  </head>

The error disappeared after commenting out the two lines below.

<%=stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'%>
<%=javascript_include_tag 'application', 'data-turbolinks-track': 'reload'%>

I tried to upgrade my gcc version, but it didn't work.

  • sudo yum-y install gcc-c++ → Installation and nothing to do
  • sudo yum install nodejs npm → Same as above

Please instruct me to resolve the error without commenting out.

ruby-on-rails centos vagrant

2022-09-30 14:59

1 Answers

Some of the following errors appear when the library version required for tool operation does not match the library version installed in the operating system.

node:/lib64/libc.so.6:version `GLIBC_2.17' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by node)

The tool requests glibc-2.14 or higher, but CentOS 6 environments only release glibc-2.12.
It will be difficult to upgrade glibc to the version provided in the distribution because it will be the package used in the core of the OS.

The choices you can take are

  • Increase the major OS version (glibc-2.17 for CentOS 7 so probably OK)
  • Reduce rails and node versions to CentOS 6 running
    (I don't know exactly which version it is.)


2022-09-30 14:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.