![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
RubyOnRails
sgzhe
这个作者很懒,什么都没留下…
展开
-
完全移除RVM
首先是移除RVM是容易的。 rvm implode 或者 rm -rf ~/.rvm其次是移除在.bashrc或.bash_profile中的如下脚本。 [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function然后是移除/etc/rvmrc文件。 ...原创 2012-09-21 09:18:56 · 1195 阅读 · 0 评论 -
在Rails4中使用carrierwave-mongoid上传文件
在Rails4和Mongoid4中,使用MongoDB's GridFS存储文件。步骤1:在Gemefile文件中添加carrierwave-mongoid。[code="ruby"]gem 'mongoid', git: 'https://github.com/mongoid/mongoid.git'gem 'mongoid-grid_fs', github: 'ahowar...原创 2013-08-09 15:06:58 · 165 阅读 · 0 评论 -
创建快速的多用户服务器
首先安装gem包eventmachine其次编写如下代码:[code="ruby"]require 'rubygems'require 'eventmachine'module EchoServer def receive_data(data) send_data ">>> You sent: #{data}" close_connecti...原创 2015-02-12 10:54:11 · 277 阅读 · 0 评论 -
通过Ruby在Windows中访问USB接口
[code="ruby"]require 'ffi' module HidApi extend FFI::Library ffi_lib 'hidapi' attach_function :hid_open, [:int, :int, :int], :pointer attach_function :hid_write, [:pointer, :point...原创 2015-02-12 14:14:43 · 203 阅读 · 0 评论