簡(jiǎn)易語(yǔ)言

          數(shù)字溝通

           

          2012年7月18日

          安裝rails(ruby on rails)

            記得兩年前使用ror做網(wǎng)站,自動(dòng)生成功能記憶猶新,只是當(dāng)時(shí)網(wǎng)絡(luò)知識(shí)實(shí)在缺乏,體會(huì)不到其中的樂(lè)趣。現(xiàn)在了解的很多了,書(shū)也有兩本,一直想重新體驗(yàn)最新版做個(gè)網(wǎng)站。安裝這個(gè)過(guò)程實(shí)在有點(diǎn)坑爹,查找網(wǎng)上若干ror的書(shū)包括2012年版的書(shū),按照上面的步驟都沒(méi)法安裝完成,搞得我一會(huì)在linux下試驗(yàn),一會(huì)在windows下試驗(yàn),都沒(méi)成功,只好放下。時(shí)間花不少,很不爽的體驗(yàn)。

            好在,過(guò)了一段時(shí)間,忽然想看看ruby的那兩本書(shū),然后就愛(ài)上這個(gè)語(yǔ)言了。于是做一些想做的試驗(yàn),一些試驗(yàn)需要做些配置,對(duì)安裝目錄也就了解了。下載一些插件居然自己跑到了ruby的下載頁(yè)。看到上面居然一個(gè)版本有3樣要下的,幫助文件和安裝文件不就夠了嗎。還要一個(gè)mingw做工具么?這個(gè)不是有自己的官網(wǎng)下載么。也沒(méi)管。想起ruby目錄下include中有i386-mingw32,才聯(lián)系起來(lái)。應(yīng)該是以mingw做make工具的。rails應(yīng)該需要make,因?yàn)槊看伟惭b都拋出make出錯(cuò)信息。雖然有mingw官網(wǎng),但這里應(yīng)該是做成自己的插件。于是到下載頁(yè)http://rubyforge.org/frs/?group_id=167下載相應(yīng)版本的mingw32工具解壓覆蓋到安裝目錄中,要是怕出問(wèn)題先對(duì)目錄做備份

            另外下載不了的都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'

            還有錯(cuò),但明顯不是曾經(jīng)報(bào)的make錯(cuò)誤了。
            按照網(wǎng)址下載和遵從上面的方法安裝即可(下面的命令即是按照安裝方法安裝的)
            其中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

            想做個(gè)實(shí)例,搜一下網(wǎng)上的書(shū),還是不行,那些書(shū)最新的2012的都不用命令行做,2011的還是老的命令行方式。根本沒(méi)法用,上官網(wǎng)看就是了。
          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/,熟悉的界面出現(xiàn)


            所以ror厚厚的書(shū)讀完也沒(méi)用,可能動(dòng)手連代碼都沒(méi)機(jī)會(huì)敲。

            另外也可以到網(wǎng)站http://railsinstaller.org/下載配置好的安裝包,就免去手動(dòng)配置啦。

          posted @ 2012-09-02 01:17 yangyusong 閱讀(4685) | 評(píng)論 (0)編輯 收藏

          涂鴉秀秀游戲項(xiàng)目介紹

            這是六月初完成的一個(gè)游戲

           

          兩個(gè)月時(shí)間終于完成了我們的涂鴉秀秀項(xiàng)目,與同類(lèi)產(chǎn)品相比,我們內(nèi)容更多些,分為雙人對(duì)戰(zhàn)模式,多人模式,相信可以同時(shí)在線很多人。

           

          技術(shù)上實(shí)踐了一把前后端都js的游戲。算是過(guò)了把小癮。用到nodejssocket.iophonegapexpress框架和其他細(xì)枝末節(jié)。一路上我們披荊斬棘,果然爽。

           

          其實(shí)從項(xiàng)目需求到解決各個(gè)小bug,真是刷了若干個(gè)夜

           

          這樣的項(xiàng)目特點(diǎn)就是能在各手機(jī)上玩,包括ipodpadPc上只要支持canvas也可以一起玩,多好的一個(gè)大融合。當(dāng)然其實(shí)要兼容ie6也不是什么難事,難在我根本沒(méi)時(shí)間理了,真不好意思。簡(jiǎn)單說(shuō)就是跨平臺(tái)。適配的機(jī)器也較多,能有較廣的群眾基礎(chǔ)。

           

          我們也有好友系統(tǒng),分享,邀請(qǐng),當(dāng)然不會(huì)做深,我們的目標(biāo)是先吸引住市場(chǎng),然后再集中力量對(duì)用戶(hù)喜歡的點(diǎn)做深入研發(fā)。

           

          做完后同學(xué)陪我玩好長(zhǎng)時(shí)間,他很喜歡玩,這一點(diǎn)讓我比較欣慰。感覺(jué)畫(huà)圖游戲來(lái)源于人類(lèi)的自戀,人類(lèi)天然喜歡用圖來(lái)表達(dá)意思。只是世界上的系統(tǒng)還是符號(hào)的多。

           

          如圖:

           

          SouApp.com還給我們蓋了章,我特地確認(rèn)了一下,這是人家主動(dòng)蓋的章。在審核的時(shí)候就下載了一百多次。當(dāng)然我也不知道這算什么概念。至少覺(jué)得有人感興趣,其實(shí)這游戲?qū)γ佬g(shù)是樂(lè)事,他們功底好,pc上有自己的畫(huà)圖板,畫(huà)起來(lái)非常專(zhuān)業(yè)。贏點(diǎn)小禮品根本不是問(wèn)題。當(dāng)然以后的版本會(huì)更好,更吸引人。已經(jīng)有不少想法,可改進(jìn)的地方也不少。

           

           

          如下是一些界面截圖


           

           

          一些小作品

           


           

          下載地址

          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

          官網(wǎng)地址

          www.tuyaxiuxiu.com

           

          兩個(gè)月我們都做了什么?

          美術(shù)需求,協(xié)議定制,詳細(xì)編碼,修bug,手機(jī)測(cè)試,穩(wěn)定服務(wù),官網(wǎng)搭建,后臺(tái)搭建,推廣運(yùn)維。非常多的細(xì)節(jié),充實(shí)有趣。

           

          現(xiàn)已通過(guò)sina,google等各大平臺(tái),能搜到精選,分享,當(dāng)然不是我們自己弄的,比如下面這個(gè)精選,人家是還要注冊(cè)才能下載的社區(qū)。我們自己搞這種就過(guò)頭了。

           

           

          如果大家覺(jué)得兩個(gè)月太長(zhǎng)了,其實(shí)試試就知道,光推廣就夠累的,各個(gè)平臺(tái)各種限制。不玩得技術(shù)欲仙欲死才怪。官網(wǎng),后臺(tái),各種修改更新。甚至圖都要自己改改。開(kāi)始半個(gè)月,美術(shù)需求就寫(xiě)了10次,不敢說(shuō)每次都很詳細(xì),但也夠有調(diào)理和詳細(xì)的了。

           

          不過(guò)從中也獲得不少經(jīng)驗(yàn),本來(lái)規(guī)劃非常短的時(shí)間來(lái)完成,這個(gè)按照很理想的條件來(lái)處理的話(huà)。當(dāng)然其實(shí)也準(zhǔn)時(shí)完成了,只不過(guò)我們又要了加倍的功能,而我們的人數(shù)從開(kāi)始實(shí)施時(shí)就減少了一半。這樣的條件下,沒(méi)報(bào)告什么特別的,既然說(shuō)了就做吧,通宵很多個(gè)晚上,弄得我經(jīng)常起不來(lái)。

           

          另一些感觸就是積極加入各種思考分析中就好,根本不要去考慮回報(bào),這個(gè)世界上能去考慮回報(bào)的人并不多。

           

          其實(shí)其中有的地方不太到位,比如分享界面、官網(wǎng)、統(tǒng)計(jì)分析。只能等人來(lái)幫忙了。

           

          如下圖是當(dāng)時(shí)做的一個(gè)極限測(cè)試

           

          當(dāng)時(shí)數(shù)據(jù)量一大就丟失數(shù)據(jù)。于是自己做了個(gè)編碼方式,減少數(shù)據(jù)量,這個(gè)圖證明的就是只要網(wǎng)絡(luò)能傳輸,內(nèi)容再多都能處理。

           

          這個(gè)游戲的不好之處就是必須有一定的玩家基數(shù)才能帶動(dòng)起來(lái)。另外,我們開(kāi)發(fā)很多功能其實(shí)沒(méi)必要,先開(kāi)發(fā)主要功能,看市場(chǎng)反應(yīng),在進(jìn)一步開(kāi)發(fā)才有意義。于是有了下一個(gè)游戲,見(jiàn)下一篇。

          posted @ 2012-07-18 15:49 yangyusong 閱讀(876) | 評(píng)論 (0)編輯 收藏

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(3)

          隨筆分類(lèi)

          隨筆檔案

          文章分類(lèi)

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 临潭县| 肥城市| 腾冲县| 恩施市| 乌鲁木齐县| 萍乡市| 无锡市| 潞西市| 马尔康县| 潜江市| 周宁县| 个旧市| 修武县| 新乐市| 双峰县| 延川县| 乌鲁木齐县| 仁怀市| 蓬溪县| 清徐县| 四子王旗| 临沭县| 石阡县| 石首市| 潮安县| 石棉县| 雅安市| 长垣县| 抚远县| 丹阳市| 萝北县| 潮州市| 宜川县| 海城市| 邳州市| 莲花县| 顺义区| 彭泽县| 阿鲁科尔沁旗| 化德县| 沙田区|