Rails(I)Win7 Environment

Rails(I)Win7 Environment

1. download and install rails

download and install ruby
http://rubyforge.org/frs/download.php/75127/rubyinstaller-1.9.2-p290.exe
>ruby -v
ruby 1.9.2p290

download and install rubygems
http://rubyforge.org/frs/download.php/74953/rubygems-1.8.5.zip

unzip the file and execute the command in the directory
d:\tool\rubygems-1.8.5>ruby setup.rb

download and install rails
d:\download>gem install rails --pre --no-ri --no-rdoc --include-dependencies

>gem install sqlite3-ruby

download and install sqlite
http://www.sqlite.org/download.html
I got these files:
sqlite-analyzer-win32-x86-3070701.zip
sqlite-dll-win32-x86-3070701.zip
sqlite-shell-win32-x86-3070701.zip

And I unzip them and copy all the files to this directory D:\tool\Ruby192\bin

2. Try a sample
d:\work\rails>rails new example

change the directory to the newly create directory
>cd example
>bundle install
>bundle update
>rake db:migrate

error message:
rake aborted!
uninitialized constant Rake::DSL
D:/tool/Ruby192/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'

solution:
find the file Rakefile, and change it as follow:
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

#require File.expand_path('../config/application', __FILE__)

#Example::Application.load_tasks

require File.expand_path('../config/application', __FILE__)
require 'rake/dsl_definition'

module ::Example
class Application
include Rake::DSL
end
end

module ::RakeFileUtils
extend Rake::FileUtilsExt
end

Example::Application.load_tasks

>bundle update
>rake db:migrate
>rails server

But it seems so slow when I run rails server. And I can not visit http://localhost:3000

references:
http://rubyonrails.org/
http://www.hashemzahran.com/riding-the-rails-installing-ruby-on-rails/
http://accidentaltechnologist.com/ruby-on-rails/running-rails-3-on-windows/
https://gist.github.com/4cd2bbe68f98f2f0249f
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值