![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ruby
robert_zhai
Life is short, cherish what we have owned !
My github is https://robertzhai.github.io 。
展开
-
ruby require
# require_relative 'trig'require 'pathname'dir = Pathname.new(__FILE__).parent . to_s + '/'# 当前文件完整路径require dir + 'trig'# require_relative 'moral'require dir + 'moral'y = Tri原创 2014-07-29 20:05:47 · 582 阅读 · 0 评论 -
rails kaminari text modify
add below views: pagination: first: "« 首页" last: "末页 »" previous: "« 上一页" next: "下一页 »" truncate: "..."原创 2014-11-24 19:11:55 · 395 阅读 · 0 评论 -
ruby include extend
module Base def show puts " base#show " endendclass Car extend BaseendCar.showclass Bus include Baseendb = Bus.newb.show原创 2014-10-21 22:58:04 · 347 阅读 · 0 评论 -
centos ROR install
#!/bin/bash#created by robert for config centos ruby on rails env#1.install dependyum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel ma原创 2014-11-04 13:41:16 · 500 阅读 · 0 评论 -
to solve gem install timeout
$ gem sources --remove https://rubygems.org/$ gem sources -a https://ruby.taobao.org/$ gem sources -l*** CURRENT SOURCES ***https://ruby.taobao.org# 请确保只有 ruby.taobao.org$ gem install rails原创 2014-10-30 22:33:12 · 562 阅读 · 0 评论 -
rake db:create error
在用mysql2的时候.运行rails server出现错误Library not loaded: libmysqlclient.18.dylib就是找不到这个文件,这个文件在mysql/lib下有的,只是位置不对所以我们可以选择sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/li原创 2014-10-30 22:45:39 · 839 阅读 · 0 评论 -
rails zeus
1. install gem install zeus2.usage zeus consolezeus server原创 2014-10-28 18:57:40 · 452 阅读 · 0 评论 -
rails better than php ?
http://sivers.org/rails2php#6 - I LOVE SQLSpeaking of tastes: tiny but important thing : I love SQL. I dream in queries. I think in tables. I was always fighting against Rails and its原创 2014-10-26 11:21:40 · 359 阅读 · 0 评论 -
Mark-and-Sweep Garbage Collection
http://www.brpreiss.com/books/opus5/html/page424.htmlvoid mark (Object p) if (!p.marked) p.marked = true; for each Object q referenced by p mark (q);Notic转载 2014-10-25 08:25:27 · 738 阅读 · 0 评论 -
ruby sinatra
今天抽空看了下sinatra这个框架,确实是个轻量级的东东,相比rails开发功能简单的很实用,有点像nodejs.原创 2014-11-30 17:02:04 · 634 阅读 · 0 评论