Samson's Blog

  • Home

  • About

  • Archives

Install Ruby on Rails on Archlinux

Posted on 2009-06-30 | Edited on 2018-11-29 | In Linux , Ruby on Rails
Symbols count in article: 2k | Reading time ≈ 3 mins.

[Overview] Here we will install ruby on rails framework on our Archlinux box. For more detail information, please refer this wiki page. [Install ruby and rubygems] First we need to install ruby and its package system rubygems: $ sudo pacman -S ruby rubygems [Install rails] Next install rails via rubygems: $ sudo gem install rails gem will help us manage all the dependencies and download them automatically. (Notes: if you execute the above command without being root (e.g. without sudo), gem will install rails in the home directory of the current user. Usually the directory is named after “.gem”, you probably need to manually add rails and rake bin directory to your PATH before you could use them, that may not be what you exactly want.) next install sqlite database since it’s rails’s default database: $ sudo pacman -S ruby-sqlite3 rails supports a lot of modern databases, but here we will only use sqlite for simplicity. Finally let’s replace rails build-in http server webrick with mongrel, which is faster and more stable, and also rails community’s recommendation. $ sudo gem install mongrel [Test rails installation] All right, that’s it, pretty simple, isn’t it? Next, let’s make sure it exactly works as we expected. test ruby, rubygems, rails and rake installation, make sure all these tools are successfully installed: $ ruby -v $ gem -v $ rails -v $ rake --version create a rails testapp with preconfiguration for sqlite 3 database: $ rails -d sqlite3 testapp next start the web server, mongrel will be booted since we have mongrel installed before, otherwise webrick will be used: $ cd testapp $ script/server as can be seen from the console output below, the default listening port is 3000:

=> Booting Mongrel => Rails 2.3.2 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server

finally fire our favorite browser to http://server-domain-or-ip:3000/ to see the rails “welcome abroad” page, and we’re done: ruby on rails installation

Update-15

Posted on 2009-06-29 | Edited on 2018-11-29 | In Life
Symbols count in article: 221 | Reading time ≈ 1 mins.

Q:最近热吗? A:我不热,我舒服死了…… Q:看不看大黄? A:大黄是啥?哦…… 极其讨厌,重来不看…… 提都不要给我提,低俗!!! Q:被忽悠是什么感觉? A:爽死了,每天不被“善意”的欺骗一下,晚上还真睡不着觉……谁以后说话不拐点弯抹点角,我跟谁急!!! Q:用过绿坝吗,怎么样?听说蛮好用的~ A:自从用了绿坝,腰不酸了,背不疼了,腿也不抽筋了,走路更有劲了,吃嘛嘛香,睡觉也更踏实了……强烈推荐大家!!!谁用后感觉不好的尽管找我!

Update-14

Posted on 2009-06-25 | Edited on 2018-11-29 | In Life
Symbols count in article: 854 | Reading time ≈ 1 mins.

1. 有些心情和反应是本能的,比如休假会开心,弱小会同情,丧亲会悲伤,五毛会恶心,屏蔽会愤怒…… 和本能的反应作对是相对困难的(至少就我本人而言),就譬如我明天休假,想让我今天非常愤怒还真不容易,呵呵 2. 大家都知道,昨天google.com被封了(特别注意:是google.com,不是google.cn),只说google的结果令我昨天一度茫然…… 昨晚事发后我在IM上广播着轮询,渴望着知音,但是得到的回复无一不是:“很好啊”,“没问题呀”,“你是不是自己电脑有问题”,“你那边网络怎么这么差的……”,“rp问题,各种bs……”……,种种回复无一不打击着我弱小的心灵,我甚至不得不开始怀疑起我悲惨的人生是不是还有继续的必要…… 后来终于知道原来丫的都被自动转到.cn去了…… 可恶的redirect,你可知道你差点害死了一条无辜的生命……(想知道怎么不被浏览器自作聪明的redirect吗?看看这篇文章,或许会对你有所帮助) 另外就不多说了,正如上面所言,有些反应是本能的,不是某些拿着鸡毛当令箭的sb媒体可以随便忽悠的了的,你有鸡毛,我有草泥马…… 3. 发现这个世界真是奇妙(我知道你早就发现了:)),前几天甄别wiki以及project management系统,因为实在太多了,所以还煞有介事的找了篇wiki来研究,以期弥补我的无知和孤陋寡闻。 终于好不容易选好了主角配角,配好灯光道具,当然也不会忘了叫助手安排好便当……呵呵,刚刚准备action,却发现原来大伙真是所见略同,同等题材作品已经上世了,没必要重造轮子了,于是火速杀青,得益于一顿没办法处理了的便当的招待,大伙也没因为大动干戈却一个镜头没拍而最后怪罪与我,为此我感到十分侥幸,这是我一个一向正直没有潜规则的导演,第一次感受到了逃脱惩罚的幸运…… 稍后不久,我考虑放上一篇在archlinux上安装配置redmine的文章,或许你会像“放逐”里那样问我,“稍后不久—— 是多久……?”,我现在可以很负责任的告诉你,那是非常久……

Update-13

Posted on 2009-06-18 | Edited on 2018-11-29 | In Life
Symbols count in article: 432 | Reading time ≈ 1 mins.

Q:最近很忙? A:嗯,至少不闲…… Q:update series是微博的合集? A:形式随便大家叫了,呵呵,mvc我来负责提供m和一种默认的v(就是目前你所看到的blog entry),如果大家有兴趣提供更多的v,我会非常乐意,并且会考虑在下个release里expose一些api给大家调哦,哦对,提供的api会是restful的,不是soap based的,更不会是xml-rpc的,呵呵 Q:你会免费提供你的数据? A:嗯,只要你遵守某个目前蛮well-known的协议。 (问后习题:如果该协议对你还不是很well-known,不要紧没关系,在本页面搜索license就能找到答案,但是看答案前请先独立思考:)) Q:什么时候会再更新? A:when expression " have_time? && have_mood? && @PCs.count > 0 " return true.

Update-12

Posted on 2009-06-12 | Edited on 2018-11-29 | In Life
Symbols count in article: 398 | Reading time ≈ 1 mins.

绿坝严肃的提醒你,该网站属不良网站,不良信息将被过滤掉!!!请自重!!! 1. 有一种宣传叫口碑,我就是被一大帮口碑男女给口碑了然后读了《杜拉拉那啥记》,故事讲述的是一位姓杜,名叫“拉拉”…… == 此信息不良,已被过滤掉 == == 绿坝花季护航,为你保驾护航 == 一天一口气看到倒数第……不知道倒数第几章,然后以后就一直没再打起精神看,据说要拍成电影了,没看过的就等着到时被口碑推着去看电影好了…… 2. 哪天再碰见着有人飞奔着去微波炉热饭,千万不能再搭话了,瞧,他热饭热的多兴奋,多带劲,不是自己做的,果然就是一个字,爽,打心眼里的爽~ 小样,终于理解你“一旦拥有,别无所求”什么意思了…… 3. 绿坝再次严肃并且严厉的警告你,你嘴角带有yin笑的浏览流氓不良网站已经超过规定时间了,请马上关闭浏览器,回去看书,不然…… 不然怎样呀?(你继续一脸yin笑着……) 不然我就去告诉老师……

Update-11

Posted on 2009-06-10 | Edited on 2018-11-29 | In Life
Symbols count in article: 658 | Reading time ≈ 1 mins.

双数ordered list format,系稳定版本;单数faq format,属于开发测试不稳定版本,谢谢 Q:绿坝是什么,最近好像很火啊? A:绿坝是我国最新推出的网络协议栈的一部分,该协议栈是OSI七层模型的升级版,有望在未来网络通信中完全取代渐渐老化并漏洞百出的TCP/IP协议栈。另据知情人士透露,绿坝在最新的九层网络协议栈中位于最高层,协议栈从下往上依次为:“物理层,链路层,网络层,传输层,会话层,GFW层,表现层,应用层,绿坝层”。绿坝目前只支持微软的windows系统,linux和mac用户为此还要苦苦等待很久一段时间,为此大部分的linux用户正考虑迁移到windows系统,苹果公司也正在积极公关中。 Q:8g的问一下,你们每天上班怎样的? A:我的情况和这个视频描述的正好相反,我工作很努力的,请你相信我。 Q:为什么我要相信你工作努力? A:因为我不仅“死了都要爱”,而且“死了都要改”…… -> http://kisshi.com/2009/05/25/a-xing/ Q:http://en.akinator.com/是什么网站? A:说实话我自己也没有搞明白,不过作为有趣信息链的传播节点,我的原则就是不做信息链终点,但坚决做8g链终点,这是我的职业素养,谢谢;顺便说一句,如果你用IE浏览器或是别的什么浏览器成功正常打开,并顺利搞明白其中奥秘,请务必回帖告诉我,我对未知事物一直充满着好奇和敬畏,对远古存在的神用谦卑的身份…… Q:最近有啥娱乐活动吗? A:写faq……

Update-10

Posted on 2009-06-08 | Edited on 2018-11-29 | In Life
Symbols count in article: 389 | Reading time ≈ 1 mins.

1. 意识到这两天是全国高考的大日子还是我妈提醒我的(之前我还以为她想给我扫盲6.*,汗我一跳),是的,5年前那个对我有着深远影响的几天早已被我忘的即便不是一干二净,至少也是已经细节全无了(喜欢8g的同学,这里有数据哦,以后别说我没给你机会:-)),我妈很乐忠的给我讲着今年高考作文是什么什么,然后我告诉她我不关心,说实话我连当年自己的作文题目也不记得了。 写这篇日志的同时,广大学子也正在父母的“踮起脚尖”的期盼下,为着不知道是不是自己真正梦想的梦想努力着…… 高考 2. 今年的WCG在中国举行,确实是对中国电子竞技发展的又一推动。不说别说你不相信,我自己都不信,WE的suho上周竟然到我们公司来了…… 无图无真相: suho comes 既来之,则打之: suho playing 3. linuxsir上看到的有趣网站:let me google that for you,如果你不知道它有啥用,请猛击这里 :)

Install Ubuntu on VirtualBox (Part 3)

Posted on 2009-06-06 | Edited on 2018-11-29 | In Linux
Symbols count in article: 2.5k | Reading time ≈ 4 mins.

Continue from the previous 2 parts: Install Ubuntu on VirtualBox (Part 1) Install Ubuntu on VirtualBox (Part 2) All right, we have finished virtualbox installation and successfully created one virtual machine on it. Now it’s the time to… [Install Ubuntu] Just treat the VM like a real physical machine, what will you do to install an OS on a new gained physical machine? Yeah, that’s right, insert a CD or DVD. Now let’s do exactly the same thing to our virtual machine. Right click the VM, select “Settings…”, and you will be greeted with a setting dialog looks like below: install ubuntu 1 A lot of settings and tweaks for this VM can be done in this dialog, right now we only need to change the “CD/DVD-ROM” setting. Choose the “CD/DVD-ROM” tab and check “Mount CD/DVD Drive”, in order to put an valid iso image file path to “ISO Image File”, click the folder-like button besides it: install ubuntu 2 “Virtual Media Manager” will be then invoked and it will provide us a way to select the iso image we want to mount: install ubuntu 3 Click “Add” button on the toolbar, and select the ubuntu iso image file we downloaded before: install ubuntu 4 “Select” it to return: install ubuntu 5 All right, we finish inserting the DVD by clicking “OK” and we’re ready to boot. To start the VM, just choose the VM then click the “Start” button on toolbar, or right click the VM then select “Start”. From now on, everything happens in the VM just like in a normal physical machine. Select language: install ubuntu 6 Select “Install Ubuntu”: install ubuntu 7 Booting…: install ubuntu 8 Choose language: install ubuntu 9 Select time zone: install ubuntu 10 Choose keyboard layout: install ubuntu 11 Prepare disk space, for simplicity here, we choose “Use the entire disk” to let Ubuntu to auto partition our disk (the virtual disk we created before, still remember? of course you do:)): install ubuntu 12 Name, password, computer name etc… : install ubuntu 13 Ready to install, confirmation: install ubuntu 14 Installing system, partition formatting… : install ubuntu 15 Installing system, copying files… : install ubuntu 16 If blocked at “Configuring apt, scanning the mirror…”, click “Devices->Network Adapters->Adapter 1” to temporary disable your network adapter, just like remove the network adapter if we are dealing with real physical machine:): install ubuntu 17 Installation complete, restart now: install ubuntu 18 Just provide a chance for you to remove the iso image (remove disk) before reboot: install ubuntu 19 Reboot, prompt for user name and password: install ubuntu 20 Boot complete, desktop ready: install ubuntu 21 Linux installation is more and more simple and elegant nowadays, isn’t it? [Next step] 1. Ubuntu 9.04 desktop edition official documentation: https://help.ubuntu.com/9.04/ 2. Linux commands http://en.wikipedia.org/wiki/List_of_Unix_utilities

Install Ubuntu on VirtualBox (Part 2)

Posted on 2009-06-05 | Edited on 2018-11-29 | In Linux
Symbols count in article: 3.1k | Reading time ≈ 5 mins.

Continue from the previous part: Install Ubuntu on VirtualBox (Part 1). We have already downloaded all the needed softwares and finish the virtualbox installation, so far so good~ Now launch the newly installed virtualbox, let’s … [Create a virtual machine] Remember we mentioned that the OS needs to be installed on a physical machine in our last post? Yeah, right now we are gonna to prepare a virtual physical machine, using virtualbox. The fresh installed virtualbox looks like below: create virtual machine 1 Click “File->Preferences…”, tweak some global settings before we start, you can modify anything you want to make you comfortable, here I recommend to change the “Default Hard Disk Folder” and “Default Machine Folder”: create virtual machine 2 After preferences setting, click the “New” button on toolbar to start the “create new virtual machine wizard”: create virtual machine 3 Click “Next”, in the next screen, input the virtual machine name and its OS type, since we are now installing ubuntu 9.04 desktop edition, we can put something looks like below: create virtual machine 4 “Next”, now the wizard asks us to input the RAM of the virtual machine, it’s now starting to look like a real machine, isn’t it? Here I assign this VM (virtual machine) 512M RAM, you can change it to meet your needs, just note that the RAM you gave to the VM will later be occupied from your real machine (the one you install windows on), so don’t assign too much memory if you don’t have so much: create virtual machine 5 “Next” comes to the hard disk, yes, it’s still a virtual one. Since we haven’t created any virtual hard disk right now, we need to select “Create new hard disk”, also check the “Boot Hard Disk (Primary Master)” option, we will later boot our ubuntu on this hard disk: create virtual machine 6 “Next”, cause we select “Create new hard disk” in the former screen, now we are heading to the “create new virtual disk wizard”: create virtual machine 7 “Next”… (why so much next:-)), we are asked to choose the virtual hard disk type, in consideration of the flexibility, we choose “Dynamic expanding storage” here, maybe a little bit slower than “Fixed-size storage”, but that’s worth it: create virtual machine 8 “Next” comes the virtual disk location and size… (why so much next? Maybe you will start to complain:), but trust me, it’s close, not so much next remains:)) since we are already finished the global “Default Hard Disk Folder” setting before, we can just leave the “Virtual Disk” setting here to its own, it will follow our global setting if we don’t explicitly set it. Since we have selected “Dynamic expanding storage” type before, the disk size here is just a maximum size of your disk, not the exact size, so feel free to set it to any size you want. The actual limit is your real physical hard disk size if you set it to a very large number, like 2T: create virtual machine 9 “Next” again, we finally see a “finish”, but don’t count your chickens now, it’s only the finish of the virtual hard disk creation:) create virtual machine 10 After click “finish”, we finally got the last “finish”, check the parameters again and click “finish” to create our first virtual machine: create virtual machine 11 After successfully creation, finally a virtual machine shows up: create virtual machine 12 We will later create ubuntu on this virtual machine in this articles’s 3rd part. To be continued…

Install Ubuntu on VirtualBox (Part 1)

Posted on 2009-06-05 | Edited on 2018-11-29 | In Linux
Symbols count in article: 1.6k | Reading time ≈ 3 mins.

[Dedication] To my friend louchx:), welcome to the Unix/Linux world! [Overview] Ubuntu is one of the most popular linux distribution nowadays. It mainly focus on usability, accessibility and internationalization, to reach as many people as possible. Refer ubuntu home page and this wiki page for more detail information about ubuntu. Usually we will need a physical machine to install an OS like ubuntu, but since that’s our first time to install linux, let’s choose another more secure way. We will use a software virtualizer to virtualize a physical machine for us. VirtualBox is a general-purpose full virtualizer for x86 hardware. According to its official home page, it is now the only professional-quality virtualization solution that is also Open Source Software. Another choice is VMware, but since it’s not free, that’s not my recommendation here. So… here we will install ubuntu on virtualbox based on windows hosts. First let’s prepare… [What we need] 1. Ubuntu 9.04 Desktop Edition 32 bit version Download the iso from http://www.ubuntu.com/getubuntu/download, choose a proper download location there 2. VirtualBox 2.2.4 for Windows hosts Download the latest release from http://www.virtualbox.org/wiki/Downloads [Install VirtualBox] VirtualBox installation is just like installing a normal windows software. That’s what you’re most familiar with, so I only attach some screenshots below. For the official installation guides on Windows host, please refer this page. virtualbox setup 1: virtualbox setup 1 virtualbox setup 2: virtualbox setup 2 virtualbox setup 3: virtualbox setup 3 virtualbox setup 4: virtualbox setup 4 virtualbox setup 5: virtualbox setup 5 virtualbox setup 6: virtualbox setup 6 virtualbox setup 7: virtualbox setup 7 To be continued…

1…282930…35
Samson Wu

Samson Wu

天与弗取,反受其咎;时至不行,反受其殃

347 posts
148 categories
140 tags
GitHub
Creative Commons
Links
  • Portfolio
  • Resume
© 2007 – 2018 Samson Wu | 309k | 8:35
0%