`
山雨欲来风满楼
  • 浏览: 57081 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Rails3 on Ubuntu 以及虚拟机Virtualbox 安装 笔记--可以节省你两天的折腾

阅读更多
#在windows上安装Ubuntu 虚拟机
1. download Ubuntu desktop 32 bit (developer to use ubuntu desktop version may is better)
http://www.ubuntu.com/desktop/get-ubuntu/download

2. install virtualbox and set the downloaded ubuntu iso as virtul disk driver and get server installed as step by step
http://www.virtualbox.org/wiki/Downloads
设置虚拟机内存为512M,可根据你机器内存来设置

3. add another network card for virtual machine in box controller machine,
关闭虚拟机后,用 box manager给 给虚拟机增加一个网卡(在设置里面)
具体请细读
http://muffinresearch.co.uk/archives/2010/02/08/howto-ssh-into-virtualbox-3-linux-guests/

vim /etc/network/interfaces

auto eth1
iface eth1 inet static
    address 192.168.56.5
    netmask 255.255.255.0

sudo ifup eth1

reboot

外部有两个网卡,为虚拟机创建,为192.168.56.x字段
内部也有两个网卡, 一个为自动分配成10.0.2.15字段
外部网卡一个要设置为nat,一个设置为host-only

虚拟机安装要诀:
虚拟机安装后,要能够从windows xp  host上能够访问到虚拟机,
本地有虚拟机的两张网卡, 内部有两个网卡, 一个为eth0,一个为eth1
把eth1设置成和host虚拟机两张网卡同一网段,就可以访问。

putty 上去虚拟机后,有时候发现有断掉的情形, 在make的时候,其他的时候还可以。

#install ubuntu gnome for server (如果直接安装桌面,就不用了)
sudo apt-get install x-window-system-core xserver-xorg gnome-desktop-environment
ref:http://ubuntuforums.org/showthread.php?t=186298
自动下载要一个小时左右, 安装也要半个小时左右,安装大小在1.5G左右
download-->uppack-->set up

#start vnc server for ubuntu server or desktop
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
# twm &

但是好像装了以后,按s 会有问题

# 安装一个guest additional  for guest ubuntu
在虚拟机里面设置光驱为:VBoxLinuxAdditions.iso
cd /media/cdrom0/
sudo ./VBoxLinuxAdditions.run

#ubuntu copy/paste with windows host is OK
using buttion in middle of mouse to copy or just right click to copy
then paste to windows, windows also can be paste into ubuntu, that is great.

#you need install some third party in ubuntu before install ruby
sudo apt-get zlib1g-dev
sudo apt-get install libsqlite3-dev

#you must need install ruby 1.9.2 Rc1 as I has tryed others will fail as rails3 official required also
ref =http://www.ruby-lang.org/en/news/2010/07/02/ruby-1-9-2-rc1-is-released/
tar xvzf  ...
$ cd ruby.../
$ ./configure
$ make
$ sudo make install

check ruby version by
ruby --version

#install ruby gems
ref=http://grigio.org/how_install_rails_3_0_beta_ubuntu_linux_step_step
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar -xvf rubygems-1.3.5.tgz
cd rubygems-1.3.5
sudo ruby1.9 setup.rb
sudo ln -s /usr/bin/ruby1.9.1 /usr/bin/ruby
sudo ln -s /usr/local/bin/gem /usr/bin/gem

sudo gem update --system


#install sqlite3-ruby gem
sudo gem install sqlite3-ruby

#安装thin服务器

sudo gem install thin

#
#install rails 3
sudo gem install rails --pre
it take about 5 minutes to show something, be patient
total take 10 minutes to install 22 gem related with rails



#create new rails application
#rails new bolg
#cd blog

thin start

in windows host, you can visit
http://192.168.56.5:3000/

rails3 welcome is there.

安装成功,继续你的网站开发。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics