Ruby打包发布
http://www.erikveen.dds.nl/distributingrubyapplications/rails.html:
In this tutorial, we'll go through the following steps: Setup the environment Create the SQLite database Develop the Rails application Create the RBA (= Ruby archive) from the application with Tar2RubyScript Create the standalone executable with RubyScript2Exe module Rails
class Configuration
def database_configuration
#conf = YAML::load(ERB.new(IO.read(database_configuration_file)).result) 会出错
conf = YAML::load(File.read(database_configuration_file))
if defined?(TAR2RUBYSCRIPT)
conf.each do |k, v|
if v["adapter"] =~ /^sqlite/
v["database"] = oldlocation(v["database"]) if v.include?("database")
v["dbfile"] = oldlocation(v["dbfile"]) if v.include?("dbfile")
end
end
end
conf
end
end
end "database"=>"E:/worksapce/temp/db/demo_development.sqlite3", oldlocation(v["database"]) 其实是在DB子目录中,而不是在当前运行的目录下
tar2rubyscript可以了
rubyscript2exe 不行,有可能是RAILS版本问题, 现在证明不是RAILS版本问题,估计是RUBY 版本问题 2.Exerb不能通过gem安装,不过安装方式也十分方便。
首先到exerb的官方网站下载exerb.链接在页面中间那个位置。
相关文档:
本文转自:
http://hi.baidu.com/24xinhui/blog/item/9f52dd34382e11325ab5f553.html
ruby-语法
2009年06月20日 星期六 上午 00:21
http://www.blogjava.net/xxllnnn/archive/2009/01/18/251762.html
http://www.cnblogs.com/cnblogsfans/archive/2009/01/24/1380804.html
__setobj__ (2009-7-14)
&nbs ......
Installing Ruby from source is my preferred method, although in Ubuntu Feisty you can supposedly install it with apt-get install ruby
now. Here’s the essential packages needed to get a source build working right though and the process I just went through:
sudo apt-get install build-essentia ......
Ruby语言学习系列--基本的ruby语法
1. 基本的ruby语法
1.1 变量、常量和类型
1) 定义变量
变量类型
描述
示例
局部变量(或伪变量)
以小写字母或下划线卡头
var _var
全局变量
以$开头
$ ......
此例子在 Ruby Ruport实践—简单报表系统 及 Ruby Ruport实践—中文PDF报表之PRAWN 的基础上进行完善,添加了对报表参数的设计及实现。
一、创建数据表report_parameters
create table report_parameters
(report_parameter_id integer not null auto_increment,
report_execute_id integer not null, ......
1. 进制的快捷转换
"100".to_i(2) , 将100作为二进制输出十进制数,
结果 : 4
"100".to_i(9), 九进制,
结果: 81
"100".to_i(16), 十六机制,
结果: 256
比较帅,字符串转换在vc编程里面比较头疼。 ......