每当我尝试去使用WebGl的网站时,它都不会加载.我正在使用09年中期的MacBook Pro(10.7.5),并运行Chrome 33.0.1750.117.我需要在某个地方启用Chrome设置才能让一切正常运行吗?
当我运行bundle install时,我在安装调试器gem(1.6.6)时遇到错误.我正在使用ruby 2.1.1和rails 4.0.4.我对rails很新,不知道是什么导致了这个问题.
错误
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
Makefile creation failed
*************************************************************
NOTE: If your headers were not found, try passing
--with-ruby-include=PATH_TO_HEADERS
*************************************************************
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably …Run Code Online (Sandbox Code Playgroud) 我试图在我的rails应用程序中使用自定义字体,但无法弄清楚我做错了什么.我在assets文件夹中创建了一个名为fonts的文件夹,其中包含我正在使用的两种字体.然后我在我的css文件中调用home.css.scss.erb中的两种字体
CSS:
@font-face {
font-family: 'Proxima Nova';
src: url('<%= asset_path(/assets/fonts/ProximaNova-Regular.otf) %>', font);
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Gotham';
src: url('<%= asset_path(/assets/fonts/Gotham-Medium.ttf) %>', font);
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
然后在application.rb的配置文件夹中我添加了
config.assets.paths << "#{Rails.root}/app/assets/fonts"
Run Code Online (Sandbox Code Playgroud)
但这似乎仍然不起作用..任何想法为什么?
我正在尝试记录图像的宽度,我尝试的每件事都返回0.任何想法为什么?这就是我到目前为止所拥有的.
jQuery的
var imgWidth = $('#imageMap').width();
console.log(imgWidth);
Run Code Online (Sandbox Code Playgroud)
生成图像的ERB
<% @image.each do |image| %>
<% image.contacts.each do |conn| %>
<span class="connection" data-pos-x="<%= conn.pos_x %>" data-pos-y="<%= conn.pos_y %>" data-pos-width="<%= conn.pos_width %>" data-pos-height="<%= conn.pos_height %>"> </span>
<% end %>
<%= f.hidden_field :image_id, value: image.id %>
<%= image_tag(image.image.url(:large), id: 'imageMap') %>
<% end %>
Run Code Online (Sandbox Code Playgroud)