简易语言

数字沟通

 

2012年7月18日

安装rails(ruby on rails)

  记得两年前使用ror做网站,自动生成功能记忆犹新,只是当时网络知识实在缺乏,体会不到其中的乐趣。现在了解的很多了,书也有两本,一直想重新体验最新版做个网站。安装这个过程实在有点坑爹,查找网上若干ror的书包括2012年版的书,按照上面的步骤都没法安装完成,搞得我一会在linux下试验,一会在windows下试验,都没成功,只好放下。时间花不少,很不爽的体验。

  好在,过了一段时间,忽然想看看ruby的那两本书,然后就爱上这个语言了。于是做一些想做的试验,一些试验需要做些配置,对安装目录也就了解了。下载一些插件居然自己跑到了ruby的下载页。看到上面居然一个版本有3样要下的,帮助文件和安装文件不就够了吗。还要一个mingw做工具么?这个不是有自己的官网下载么。也没管。想起ruby目录下include中有i386-mingw32,才联系起来。应该是以mingw做make工具的。rails应该需要make,因为每次安装都抛出make出错信息。虽然有mingw官网,但这里应该是做成自己的插件。于是到下载页http://rubyforge.org/frs/?group_id=167下载相应版本的mingw32工具解压覆盖到安装目录中,要是怕出问题先对目录做备份

  另外下载不了的都cross wall下载


C:\Documents and Settings\Administrator>gem install rails
ERROR:  Error installing rails:
        The 'json' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

  还有错,但明显不是曾经报的make错误了。
  按照网址下载和遵从上面的方法安装即可(下面的命令即是按照安装方法安装的)
  其中config.yml文件仅仅描述ruby所在路径,修改成你的ruby路径即可

D:\>cd D:\Ruby192\devkit

D:\Ruby192\devkit>ruby dk.rb init
[INFO] found RubyInstaller v1.9.2 at D:/Ruby192

Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.

D:\Ruby192\devkit>ruby dk.rb review
Based upon the settings in the 'config.yml' file generated
from running 'ruby dk.rb init' and any of your customizations,
DevKit functionality will be injected into the following Rubies
when you run 'ruby dk.rb install'.

D:/Ruby192

D:\Ruby192\devkit>ruby dk.rb install
[INFO] Updating convenience notice gem override for 'D:/Ruby192'
[INFO] Installing 'D:/Ruby192/lib/ruby/site_ruby/devkit.rb'

D:\Ruby192\devkit>gem install rdiscount --platform=ruby
Fetching: rdiscount-1.6.8.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed rdiscount-1.6.8
1 gem installed
Installing ri documentation for rdiscount-1.6.8...
Installing RDoc documentation for rdiscount-1.6.8...

D:\Ruby192\devkit>ruby -rubygems -e "require 'rdiscount'; puts RDiscount.new('**
Hello RubyInstaller**').to_html"
<p><strong>Hello RubyInstaller</strong></p>

下面安装rails

D:\Ruby192\devkit>gem install rails
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Fetching: rdoc-3.12.gem (100%)
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Fetching: railties-3.2.8.gem (100%)
Fetching: bundler-1.2.0.gem (100%)
Fetching: rails-3.2.8.gem (100%)
Successfully installed json-1.7.5
Successfully installed rdoc-3.12
Successfully installed railties-3.2.8
Successfully installed bundler-1.2.0
Successfully installed rails-3.2.8
5 gems installed
Installing ri documentation for json-1.7.5...
Installing ri documentation for rdoc-3.12...
unable to convert U+00A9 from UTF-8 to GBK for lib/rdoc/text.rb, skipping
Installing ri documentation for railties-3.2.8...
Installing ri documentation for bundler-1.2.0...
Installing ri documentation for rails-3.2.8...
Installing RDoc documentation for json-1.7.5...
Installing RDoc documentation for rdoc-3.12...
unable to convert U+00A9 from UTF-8 to GBK for lib/rdoc/text.rb, skipping
Installing RDoc documentation for railties-3.2.8...
Installing RDoc documentation for bundler-1.2.0...
Installing RDoc documentation for rails-3.2.8...

  果然成功了,哈哈

D:\Ruby192\devkit>rails -v
Rails 3.2.8

  想做个实例,搜一下网上的书,还是不行,那些书最新的2012的都不用命令行做,2011的还是老的命令行方式。根本没法用,上官网看就是了。
D:\Ruby192\devkit>rails new D:/project/ruby/railsapp
      create
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/images/rails.png
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/mailers
      create  app/models
      create  app/views/layouts/application.html.erb
      create  app/mailers/.gitkeep
      create  app/models/.gitkeep
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/secret_token.rb
      create  config/initializers/session_store.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  doc
      create  doc/README_FOR_APP
      create  lib
      create  lib/tasks
      create  lib/tasks/.gitkeep
      create  lib/assets
      create  lib/assets/.gitkeep
      create  log
      create  log/.gitkeep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/favicon.ico
      create  public/index.html
      create  public/robots.txt
      create  script
      create  script/rails
      create  test/fixtures
      create  test/fixtures/.gitkeep
      create  test/functional
      create  test/functional/.gitkeep
      create  test/integration
      create  test/integration/.gitkeep
      create  test/unit
      create  test/unit/.gitkeep
      create  test/performance/browsing_test.rb
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/javascripts/.gitkeep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.gitkeep
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
         run  bundle install
Fetching gem metadata from https://rubygems.org/.........
Installing rake (0.9.2.2)
Installing i18n (0.6.1)
Installing multi_json (1.3.6)
Using activesupport (3.2.8)
Using builder (3.0.0)
Using activemodel (3.2.8)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using sprockets (2.1.3)
Using actionpack (3.2.8)
Installing mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.8)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.8)
Using activeresource (3.2.8)
Using bundler (1.2.0)
Installing coffee-script-source (1.3.3)
Installing execjs (1.4.0)
Installing coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.5)
Using rdoc (3.12)
Installing thor (0.16.0)
Using railties (3.2.8)
Installing coffee-rails (3.2.2)
Installing jquery-rails (2.1.1)
Using rails (3.2.8)
Installing sass (3.2.1)
Installing sass-rails (3.2.5)
Using sqlite3 (1.3.6)
Installing uglifier (1.2.7)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem
is installed.

D:\Ruby192\devkit>cd D:\project\ruby\railsapp

D:\project\ruby\railsapp>rails server
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-09-01 06:44:40] INFO  WEBrick 1.3.1
[2012-09-01 06:44:41] INFO  ruby 1.9.2 (2011-07-09) [i386-mingw32]
[2012-09-01 06:44:41] INFO  WEBrick::HTTPServer#start: pid=2924 port=3000

  浏览器中输入http://localhost:3000/,熟悉的界面出现


  所以ror厚厚的书读完也没用,可能动手连代码都没机会敲。

  另外也可以到网站http://railsinstaller.org/下载配置好的安装包,就免去手动配置啦。

posted @ 2012-09-02 01:17 yangyusong 阅读(4647) | 评论 (0)编辑 收藏

涂鸦秀秀游戏项目介绍

  这是六月初完成的一个游戏

 

两个月时间终于完成了我们的涂鸦秀秀项目,与同类产品相比,我们内容更多些,分为双人对战模式,多人模式,相信可以同时在线很多人。

 

技术上实践了一把前后端都js的游戏。算是过了把小瘾。用到nodejssocket.iophonegapexpress框架和其他细枝末节。一路上我们披荆斩棘,果然爽。

 

其实从项目需求到解决各个小bug,真是刷了若干个夜

 

这样的项目特点就是能在各手机上玩,包括ipodpadPc上只要支持canvas也可以一起玩,多好的一个大融合。当然其实要兼容ie6也不是什么难事,难在我根本没时间理了,真不好意思。简单说就是跨平台。适配的机器也较多,能有较广的群众基础。

 

我们也有好友系统,分享,邀请,当然不会做深,我们的目标是先吸引住市场,然后再集中力量对用户喜欢的点做深入研发。

 

做完后同学陪我玩好长时间,他很喜欢玩,这一点让我比较欣慰。感觉画图游戏来源于人类的自恋,人类天然喜欢用图来表达意思。只是世界上的系统还是符号的多。

 

如图:

 

SouApp.com还给我们盖了章,我特地确认了一下,这是人家主动盖的章。在审核的时候就下载了一百多次。当然我也不知道这算什么概念。至少觉得有人感兴趣,其实这游戏对美术是乐事,他们功底好,pc上有自己的画图板,画起来非常专业。赢点小礼品根本不是问题。当然以后的版本会更好,更吸引人。已经有不少想法,可改进的地方也不少。

 

 

如下是一些界面截图


 

 

一些小作品

 


 

下载地址

http://souapp.com/app_detail/?appid=aaf7a621-205a-4c73-a88b-a5ef3ebb9431

 

http://www.appchina.com/soft_detail_291505_0_10.html

 

游戏地址

m.tuyaxiuxiu.com

360.tuyaxiuxiu.com

google.tuyaxiuxiu.com

官网地址

www.tuyaxiuxiu.com

 

两个月我们都做了什么?

美术需求,协议定制,详细编码,修bug,手机测试,稳定服务,官网搭建,后台搭建,推广运维。非常多的细节,充实有趣。

 

现已通过sina,google等各大平台,能搜到精选,分享,当然不是我们自己弄的,比如下面这个精选,人家是还要注册才能下载的社区。我们自己搞这种就过头了。

 

 

如果大家觉得两个月太长了,其实试试就知道,光推广就够累的,各个平台各种限制。不玩得技术欲仙欲死才怪。官网,后台,各种修改更新。甚至图都要自己改改。开始半个月,美术需求就写了10次,不敢说每次都很详细,但也够有调理和详细的了。

 

不过从中也获得不少经验,本来规划非常短的时间来完成,这个按照很理想的条件来处理的话。当然其实也准时完成了,只不过我们又要了加倍的功能,而我们的人数从开始实施时就减少了一半。这样的条件下,没报告什么特别的,既然说了就做吧,通宵很多个晚上,弄得我经常起不来。

 

另一些感触就是积极加入各种思考分析中就好,根本不要去考虑回报,这个世界上能去考虑回报的人并不多。

 

其实其中有的地方不太到位,比如分享界面、官网、统计分析。只能等人来帮忙了。

 

如下图是当时做的一个极限测试

 

当时数据量一大就丢失数据。于是自己做了个编码方式,减少数据量,这个图证明的就是只要网络能传输,内容再多都能处理。

 

这个游戏的不好之处就是必须有一定的玩家基数才能带动起来。另外,我们开发很多功能其实没必要,先开发主要功能,看市场反应,在进一步开发才有意义。于是有了下一个游戏,见下一篇。

posted @ 2012-07-18 15:49 yangyusong 阅读(842) | 评论 (0)编辑 收藏

导航

统计

常用链接

留言簿(3)

随笔分类

随笔档案

文章分类

搜索

最新评论

阅读排行榜

评论排行榜