ruby-on-rails - rails的命令问题
问题描述
该rails s
命令在下面显示此问题;我不知道它是什么?这个项目使用运行良好;我也没有太大变化。
[vns@betito perseus]$ rails s
/usr/include/c++/8/bits/stl_vector.h:932: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = v8::Handle<v8::Value>; _Alloc = std::allocator<v8::Handle<v8::Value> >; std::vector<_Tp, _Alloc>::reference = v8::Handle<v8::Value>&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
Aborted (core dumped)
我的环境:
Fedora 28
ruby 2.5.1
rails 5.2.0
libg++ 8.1.1
奇怪的是我在另一个项目中执行了相同的命令,它运行得很好。
我错过了什么?
[vns@betito perseus]$ rails
The most common rails commands are:
generate Generate new code (short-cut alias: "g")
console Start the Rails console (short-cut alias: "c")
server Start the Rails server (short-cut alias: "s")
test Run tests except system tests (short-cut alias: "t")
test:system Run system tests
dbconsole Start a console for the database specified in config/database.yml
(short-cut alias: "db")
new Create a new Rails application. "rails new my_app" creates a
new application called MyApp in "./my_app"
All commands can be run with -h (or --help) for more information.
In addition to those commands, there are:
/usr/include/c++/8/bits/stl_vector.h:932: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = v8::Handle<v8::Value>; _Alloc = std::allocator<v8::Handle<v8::Value> >; std::vector<_Tp, _Alloc>::reference = v8::Handle<v8::Value>&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
Aborted (core dumped)
如果我沿着它尝试命令,但它最终坏了。
解决方案
似乎是这个' gem "less-rails" ';谢谢您的帮助
我删除了 gem,服务器运行正常;我必须检查是否有适用的旧版本。
该问题与Fedora 28 中默认打开的_GLIBCXX_ASSERTIONS编译标志有关;它会导致很多软件故障。
更多更新:我发现了这个问题,它与 'therubyracer' 库有关。使用超出范围的向量存在错误。
到这一行:返回 &vector[0];
存档:ext/v8/rr.h#L223
所以现在 libstdc++ 8.1 正在检查断言是否打开。
我使用我自己的分支库对其进行了测试,它正在工作。
推荐阅读
- gerrit - gerrit:无法访问设置页面
- node.js - 即使您输入有效命令,仍会弹出未知命令消息
- javascript - 使用 const 值作为联合类型选项
- c++ - QTabBar设置为东或西时如何设置图标?
- javascript - Node.js - 读取流返回 ENOENT(errornr #4058)
- react-bootstrap-typeahead - onChange 事件清除输入
- ruby-on-rails - 从 rails 5.1.7 中的资产管道迁移后,无法使用 webpacker 让 javascript 工作
- java - H2:多行插入语句出错
- java - 包含方法没有给出正确的输出
- c# - 针对不同环境和不同版本运行测试 C#-MSTest