(windows) Ruby On Rails开发环境安装及启动记录
1.下载Rails DevKit:railsinstaller-version.exe 下载地址 http://railsinstaller.org/?
2.下载RubyGems:rubygems-version.zip 下载地址 http://rubygems.org/pages/download
3.下载bundle install需要的包BundleInstall.zip(组件及版本见附录。因为我dos下用命令安装时,用了很长时间,所以把安装后增加的文件上传到csdn。可以不下载,直接使用命令)。下载地址http://download.csdn.net/download/loveanna7/5129196
4.安装ruby和rails。执行railsinstaller-version.exe安装rails,里面包含了ruby,会一并安装上
5.安装完成后可以进入dos执行命令查看版本号:ruby -v;rails -v
6.安装ruby gems。解压rubygems-version.zip,并在dos中cd rubygems-version(进入到解压后文件夹中包含setup.rb文件的目录下)执行 ruby setup.rb
7.创建一个Rails demo,在dos中cd到你的工作目录,如我的:E:\works\ruby,执行rails new demo --skip-bundle 。--skip-bundle意思是跳过检测安装bundle
8.cd到demo目录(如果下载了BundleInstall.zip解压到demo目录下)
9.dos下执行:gem install bundler
10.dos下执行:bundle install(如果把BundleInstall.zip解压到了demo目录下,执行的结果就像附录中一样,否则会自动fetch gem自动安装,等待就行。)
11.rails server(之所以要执行9、10是因为如果没有执行,到这一步会出错。9、10两步的命令只要执行一次就可以,之后新创建其他工程时将.bundle和 turn两个文件夹复制到新的工程中就可以了,<.bundle这个文件夹不确定需不需要>)
12.服务启动成功显示:
=> Booting WEBrick
=> Rails 3.2.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
? ? ? ? SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
? ? ? ? This poses a security threat. It is strongly recommended that you
? ? ? ? provide a secret to prevent exploits that may be possible from crafted
? ? ? ? cookies. This will not be supported in future versions of Rack, and
? ? ? ? future versions will even invalidate your existing user cookies.
?
? ? ? ? Called from: E:/works/rubytest/depot/turn/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.
?
[2013-03-11 17:29:30] INFO ?WEBrick 1.3.1
[2013-03-11 17:29:30] INFO ?ruby 1.9.3 (2012-02-16) [i386-mingw32]
[2013-03-11 17:29:30] INFO ?WEBrick::HTTPServer#start: pid=5328 port=3000
13.浏览器打开http://localhost:3000
?
附录:
demo>bundle install
Using rake (10.0.3)
Using i18n (0.6.4)
Using multi_json (1.6.1)
Using activesupport (3.2.1)
Using builder (3.0.4)
Using activemodel (3.2.1)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.5)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.5)
Using sprockets (2.1.3)
Using actionpack (3.2.1)
Using mime-types (1.21)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.1)
Using arel (3.0.2)
Using tzinfo (0.3.36)
Using activerecord (3.2.1)
Using activeresource (3.2.1)
Using coffee-script-source (1.6.1)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.3)
Using json (1.7.7)
Using rdoc (3.12.2)
Using thor (0.14.6)
Using railties (3.2.1)
Using coffee-rails (3.2.2)
Using jquery-rails (2.2.1)
Using bundler (1.3.2)
Using rails (3.2.1)
Using sass (3.2.7)
Using sass-rails (3.2.6)
Using sqlite3 (1.3.7)
Using uglifier (1.3.0)
Your bundle is complete! It was installed into ./turn
?
?