我无法安装eventmachine
好的,我知道这已被问了很多,但到目前为止我找不到任何解决方案帮助了我.所以我作为最后的手段在这里发布.
我使用( windows 8 x64
通过ruby 2.0.0p195 (x64)
Ruby Installer for Windows安装适当的Devkit)
所以错误是
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
C:/Ruby200-x64/bin/ruby.exe extconf.rb
checking for main() in -lssl... no
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... no
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for windows.h... yes
checking for winsock.h... …
Run Code Online (Sandbox Code Playgroud) 我目前正在开始构建一个开源的商店目录应用程序.
我有FunShop
和FunSubcategory
模型加入虽然FunSubcategorization
模型与has_many :through
assosiation.在FunShop
表单中,我Subcategory
以这种方式添加了复选框.
<div class="field">
<%= hidden_field_tag "fun_shop[fun_subcategory_ids][]", nil %>
<% FunSubcategory.all.each do |category| %>
<%= check_box_tag "fun_shop[fun_subcategory_ids][]", category.id, @fun_shop.fun_subcategory_ids.include?(category.id), id: dom_id(category) %>
<%= label_tag dom_id(category), category.title %>
<% end %>
</div>
Run Code Online (Sandbox Code Playgroud)
当我提交表单时,会Unpermitted parameters: fun_subcategory_ids
出现错误.
我对强参数了解一点,我怀疑它存在问题.在我的FunShop
控制器中我有这个:
def fun_shop_params
params.require(:fun_shop).permit(:fun_subcategory_ids)
end #Most code ommited for simplicity
Run Code Online (Sandbox Code Playgroud)
我也在我的FunShop模型中完成了这个:
accepts_nested_attributes_for :fun_subcategorizations
Run Code Online (Sandbox Code Playgroud)
我的第一个网络应用程序中有一个相关的存储库.