Rails 3 on Windows

本文介绍如何在 Windows 系统上安装 Ruby 1.9.2 和 Rails 3,并创建一个简单的 Rails 应用。通过下载安装 Ruby,使用命令提示符安装 Rails,创建新的 Rails 项目并配置依赖,最终实现一个带有数据库迁移和服务器启动的应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原始地址:http://matt-hulse.com/articles/2010/08/25/another-go-with-rails-3-on-windows/

 

It has been awhile since we last looked at Rails 3 on Windows and a lot has changed.

Start by downloading and installing Ruby 1.9.2p0 from here.

Once installed, open a command prompt and install rails:

gem install rails --pre --no-ri --no-rdoc

Create a new rails app:

rails new TestRails3

Now make sure the dependencies are met:

cd TestRails3
bundle install

(at this point, more work may need to be done to get sqlite working. You can download the dll fromhere. Copy the dll into the System Path. I use C:\Tools and add that directory to the path. The Ruby bin directory works too.)

Now create some scaffolding:

rails g scaffold post title:string body:text
rake db:migrate


And start the server:

rails server

Navigate to http://localhost:3000/posts and see that everything is working.
You are now riding Rails 3 on Windows!

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值