Ruby and Rails
文章平均质量分 67
linhx
APACHE Flume Hive等开源贡献者
大数据专家、IBM BI 认证专家
目前专注数据挖掘机器学习等领域
展开
-
Failed to execute rake db:create
D:/Nebular/Ruby192/bin>rake db:createrake aborted!No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)D:/Nebular/Ruby192/lib/ruby/1.9.1/rake.rb:2367:in `raw_load_rakefile'D:/Nebular/Ruby192/lib/ruby/1.9.1/rake.rb:2007:in `b原创 2010-10-03 16:50:00 · 1638 阅读 · 0 评论 -
guides.rubyonrails.org 读书笔记(十): Layouts and Rendering in Rails
Layouts and Rendering in Rails 1 Overview: How the Pieces Fit Together主要在控制器实现这些功能 2 Creating Responses三种方法: Call render to create a full response to send back to the browse原创 2011-06-06 20:01:00 · 1025 阅读 · 0 评论 -
Rails CMS 个人blog
Rails 的CMS类型特别多,经过简单比较,选择了refinerycms。 考虑有几点:1. 性价比,有免费版本100% free and open source,性能也还不错,拥有它所宣称的一切优点(废话了);2. 文档详细,http://refinerycms.com/guides;3. 扩展性好;4. 该项目本身不断地进行更新维护; 制作过程:1. Inst原创 2011-06-15 17:33:00 · 1738 阅读 · 0 评论 -
gem 卸载所有的gem, 重新安装某类型的gem
1, 卸载所有的gem,并且重新安装sudo gem list | cut -d" " -f1 > gem_list.txtcat gem_list.txt | xargs sudo gem uninstall -aIxcat gem_list.txt | xargs sudo gem install2, 卸载所有与带refinerycms的gem, 并且重新安装这些gem原创 2011-06-18 22:17:00 · 8773 阅读 · 0 评论 -
Rails console 无法启动
leslin@leslinUbt:~/workspace/rorails/leslincms$ rails console/usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.8/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /usr/lo原创 2011-06-19 20:56:00 · 2678 阅读 · 0 评论 -
uninitialized constant Rake::DSL
:~/workspace/rorails/leslincms$ heroku rake db:migrate/usr/local/ruby/lib/ruby/gems/1.9.1/gems/heroku-2.3.3/lib/heroku/helpers.rb:111: warning: Insecure world writable dir /usr/local/ruby/bin in P原创 2011-06-19 23:05:00 · 1554 阅读 · 0 评论 -
REST比较准确的定义
REST本身的含义倒是不复杂,但要比较准确地描述出来,倒真不简单了。 Ruby on Rails Guides的解释倒是不错:Rest stands for Representational State Transfer and is the foundation of the原创 2011-02-23 15:37:00 · 739 阅读 · 0 评论 -
Git Heroku 基本命令总结
1, Git 详细参考 http://help.github.com/linux-set-up-git/ 完成:(1)Git 安装(一般安装了RoR,这Git早就安装好了);(2)生成SSH;Quick Guide 1:Creating and Commiting$ cd (project-directory)$ git init$ (add s原创 2011-06-21 15:41:00 · 2802 阅读 · 0 评论 -
Ubuntu Server 10.10 安装配置 RVM Ruby Rails3 passenger nginx MySQL
1. 以非root用户更新系统sudo apt-get updatesudo apt-get upgrade2. 设置主机名,如果是系统是图形安装的,则这步骤可以忽略sudo hostname your-hostnameAdd 127.0.0.1 your-hostname:sudo vim /etc/hostsWrite your-hostname in:s原创 2011-02-24 22:46:00 · 3237 阅读 · 2 评论 -
How to change Rails App name
1. First change all app old name to new name under app folder. 2. Then change web server config under web server config file, like sudo vi /opt/nginx/conf/nginx.conf3. change database name原创 2012-06-10 09:05:46 · 1153 阅读 · 1 评论 -
ruby on rails gems
Rails Authdevise用户注册登录,身份验证的整套解决方案, 用于快速构建用户功能,如:注册,登陆,个人设置,找回密码...omniauth实现第三方登录认证,包括Twitter,Facebook,微博等等, 新浪微博, 腾讯QQ; RailsCast: Part1 Part2cancan为不同用户设定不同级别的权限原创 2013-08-24 16:38:44 · 1147 阅读 · 0 评论 -
Ubuntu Server 10.10 安装配置 Ruby Rails3 passenger nginx MySQL
Ubuntu Server 10.10 安装配置 Ruby Rails3 passenger nginx MySQL新换****,现在重新弄了个开发环境:这回不用RVM,降低复杂性。Ruby1. sudo apt-get updatesudo apt-get upgrade2.sudo apt-get install curl git3. 安装编译工具, c相关的工具都安装了,也不差那点磁盘空间sudo apt-get install build-essential原创 2011-03-29 18:36:00 · 3627 阅读 · 1 评论 -
guides.rubyonrails.org 读书笔记(九)
Migrations<br />Migrations are a convenient way for you to alter your database in a structured and organized manner.<br /> 1 Anatomy of a Migration<br />Migrations are not limited to changing the schema. You can also use them to fix bad data in the databas原创 2011-04-10 13:31:00 · 713 阅读 · 0 评论 -
Ruby install on RHEL 5.5 Linux 64
Link: https://github.com/imeyer/ruby-1.9.2-rpmThe following instructions assume installation on a 32-bit platform. For 64-bit replace i386 with x86_64 .yum install -y rpm-buildcd /usr/src/redhat/SOURCESwget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-原创 2011-05-13 17:06:00 · 1373 阅读 · 0 评论 -
Rail 3流行插件与替换部件简介
1. Active Merchant用于电子商业,处理电子支付事务。Active Merchant is an extraction from the e-commerce system Shopify. Shopify's requirements for a simple and unified API to access dozens of different payment gateways with very different internal APIs w原创 2011-03-24 16:36:00 · 1408 阅读 · 0 评论 -
redhat rhel5 升级 ruby 安装 rails3
系统自带ruby 为 1.8.5,需要升级。(1) 下载源代码,放置/usr/local/ruby-1.8.7-p330(2) 编译安装/usr/local/ruby-1.8.7-p330./configure --prefix=/usr/local/ruby-1.8.7-p330makemake install(3)设置环境变量路径export PATH=/usr/local/ruby-1.8.7-p330/bin:$PATH[root@grnvm170 bin]# echo $PATH/usr/lo原创 2011-01-02 21:48:00 · 1920 阅读 · 0 评论 -
guides.rubyonrails.org 读书笔记(二)
1.Getting Started with Rails1.1 数据在MVC之间共享传递的问题1.22. Action Controller Overview2.1 ParametersThere are two kinds of parameters possible in a web application. Rails does not make any distinction between query string parameters and POST parameters, and bot原创 2011-02-27 22:44:00 · 656 阅读 · 0 评论 -
guides.rubyonrails.org 读书笔记(三)
Action Controller Overview<br />For most conventional RESTful applications, the controller will receive the request (this is invisible to you as the developer), fetch or save data from a model and use a view to create HTML output. <br /> <br />1. Met原创 2011-03-01 16:10:00 · 654 阅读 · 0 评论 -
guides.rubyonrails.org 读书笔记(四)
Migrations<br />Migrations also allow you to describe these transformations using Ruby. The great thing about this is that (like most of Active Record’s functionality) it is database independent<br /> <br />1.1 Migrations are Classes<br /> <br />On dat原创 2011-03-04 15:47:00 · 590 阅读 · 0 评论 -
guides.rubyonrails.org 读书笔记(六)
A Guide to Active Record AssociationsTo learn more about the different types of associations, read the next section of this guide. That’s followed by some tips and tricks for working with associations, and then by a complete reference to the methods原创 2011-03-07 17:41:00 · 796 阅读 · 0 评论 -
用vim打造Rails开发利器
操作系统:Ubuntu Server 10.10(1)安装vimsudo apt-get install vimsudo apt-get install vim-gtk(2)查找一下VIM路径root@ubuntuServerof:~# find / -name vimrc/etc/vim/vimrc/usr/share/vim/vimrcroot@ubuntuServerof:~# ls -l /etc/vim/vimrc-rw-r--r-- 1 root root 2215 2010-0原创 2011-03-09 00:08:00 · 2307 阅读 · 0 评论 -
guides.rubyonrails.org 读书笔记(五)
Active Record Validations and Callbacks 1 The Object Life CycleActive Record provides hooks into this object life cycle so that you can control your application and its data. 保证Rails object在创建、更新、销毁过程都是可控的。(1)Validations allow you to ensure that only val原创 2011-03-06 18:56:00 · 633 阅读 · 0 评论 -
Rails IDE Aptana Studio
Rails IDE 有很多选择,但是具体到ubuntu 64bit 选择的余地就不多了,这里选择Aptana Studio 3 Beta1 下载 http://www.aptana.com/downloads/start2 根据 要求安装sun JDK 1.6.*安装步骤参考:1. 编辑 /etc/apt/sources.list,去掉注释:## Uncomment the following two lines to add software from Canonical's## 'partner'原创 2011-03-09 13:25:00 · 2191 阅读 · 0 评论 -
利用to_param实现Ruby on Rails 的URL优化
Active Model ConversionsHandles default conversions: to_model, to_key and to_param.to_param() Returns a string representing the object’s key suitable for use in URLs,or nil if persisted? is false在线资料:http://my原创 2011-03-09 22:15:00 · 1657 阅读 · 0 评论 -
guides.rubyonrails.org 读书笔记(七)
Rails Routing from the Outside In 1 The Purpose of the Rails Router(1)The Rails router recognizes URLs and dispatches them to a controller’s action. (2)It can also generate paths and URLs, avoiding the need to hardcode strings in your views. 1.1 Connec原创 2011-03-10 12:49:00 · 1027 阅读 · 0 评论 -
guides.rubyonrails.org 读书笔记(八)
A Guide to Testing Rails Applications1 Why Write Tests for your Rails Applications?<br /> <br />Rails tests can also simulate browser requests and thus you can test your application’s response without having to test it through your browser.<br />这是个好的观原创 2011-03-13 14:25:00 · 920 阅读 · 0 评论 -
单独地跑rails 3 单元测试中的单个case的(LoadError)问题及解决方法
<br /><br />:~/rorails/helloNignx/test/unit$ ruby ./post_test.rb <br /><internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- test_helper (LoadError)<br /> from <internal:lib/rubygems/custom_require>:29:in `require'<br />原创 2011-03-13 14:27:00 · 1200 阅读 · 0 评论 -
Ruby test unit的几点注意事项
1. First, require the Person class itself and the Test::Unit framework:# test/person_test.rbrequire File.join(File.dirname(__FILE_ _), '..', 'app', 'person')require 'test/unit' 2. Next, exte原创 2011-05-16 17:12:00 · 2702 阅读 · 0 评论