Rails 以一长串关于已初始化常量的警告开始。这是警告列表
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_AIO_LISTIO_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_AIO_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_AIO_PRIO_DELTA_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_ARG_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_ATEXIT_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_BC_BASE_MAX
... and many more from the same ruby path
Run Code Online (Sandbox Code Playgroud)
这似乎不会产生问题,但有点烦人。有人知道如何解决这些警告吗?
在另一个论坛中,我发现了这个对我有用的代码:
var chart = new Chartist.Bar('.ct-chart', {
labels: ['Test', 'Long test', 'Very long test'],
series: [[1, 5, 3]]
});
// Uncomment this line to test rendering without foreign objects
//chart.supportsForeignObject = false;
chart.on('draw', function(event) {
// If the draw event is for labels on the x-axis
if(event.type === 'label' && event.axis.units.pos === 'x') {
// If foreign object is NOT supported, we need to fallback to text-anchor and event.width / 2 offset.
if(!chart.supportsForeignObject) {
event.element.attr({
x: event.x + event.width / …Run Code Online (Sandbox Code Playgroud)