新手问题 RailsGirls 要用到的开发环境 [Windows]

southwolf · December 13, 2012 · Last by yzhang replied at December 16, 2012 · 4885 hits

Rails Installer Sublime Text

Heroku Toolbelt

2.测试 rails 和 JS Runtime

rails new blog
rails g scaffold Post title:string content:text
rake db:migrate
rails s

访问http://localhost:3000/posts

3.建 git

git init
git add .
git commit -m "Initial Commit"

4.Heroku 部署

注册 heroku 账号 经测试 QQ 邮箱、163 邮箱、Live.com 都会判为垃圾邮件

https://api.heroku.com/signup

填写 email 地址,验证邮件。

gem install heroku
heroku login 填写账号密码
heroku create
git push heroku master

** Update: JS runtime 问题 **

现在的 execjs 应该可以检测到 Windows 的 CScript 运行环境,所以不需要 therubyracer 或者 nodejs。但问题是我测试了几台电脑,其中有一台还是会出现 JS Runtime 错误。 最后发现是 execjs 跟 Win8 有兼容性问题 http://ruby-china.org/topics/7523 https://github.com/sstephenson/execjs/issues/111

还有 Heroku 不支持 sqlite 的问题……好久不用 sqlite 都忘了这回事了。 无论换 redis/mongodb 还是用 postgresql 似乎都不那么让人舒服……各位元芳,怎么解决?

靠,win 下搞 ruby,是你搞 ruby 还是 ruby 搞你,个人感觉 win 就是一套游戏机系统,不适合开发。

ruby 以及 rails 从来没有限定开发环境,都是某些 gem 限定环境造成的 再说 heroku 可以直接用 git push 代码上去不需要 gem

update JS runtime 问题我没遇到

谁决定用 Windows 系统开发 Ruby 的。。

同问,谁决定用 WINDOWS 的?套用 WOW 的开场电影里 Demon Hunter 的那句话。...

哈,到了现场我肯定使劲喷这事儿。

#6 楼 @xiaolai 捣鼓一中午了 windows 底下各种坑啊…问题是活动还得搞,妹子还得教,总不能先给妹子们重装系统吧= =#

#7 楼 @southwolf 喷和不支持,是两回事儿。喷归喷,支持是一定支持。哈。公益很重要哈。

试下这个?现场有老师就会还好

https://github.com/rails/rails-dev-box

#9 楼 @knwang 多谢!虚拟机也是可行的,但我觉得现场一片混乱的情况下要给几十个人挨个 COPY 一个几百兆的虚拟机文件(考虑到可能还有笔记本 BIOS 没开虚拟化选项、virtualbox 装不上等等问题),或者在龟速的 wifi 上拖 vagrant box/puppet安装,估计效果会更差……

不管用什么方式安装,都要做好有人没办法安装上的准备。可以准备好让两个人结对,这样只要有一半的人装好就可以了。

如果单纯只是要 windows 下的开发环境的话,http://railsinstaller.org/ 最简单,话说我在 Mac 下也是用它起的步。

你的需求主要是要部署到 heroku,试了一下,似乎应该使用 https://toolbelt.herokuapp.com/windows,我试着安装了一下,并没有覆盖掉我原来的 ruby 路径的。

用这两个安装文件,再加上 sublime,windows 下其实也是超级简单的。

sqlite 的问题,无解,你选了这个环境,就必须受这个环境的限制。

#12 楼 @xhj6 嗯 Rails Installer 是最简单的。之前我也是采用 Rails Installer,但因为它自带的 Rails 版本是 3.2.1, 所以还需要跟大家确认一下有没有其他问题。Rails FTW 只是作为备选。 heroku app 是我设置的问题。它会在环境变量里添加自带的 ruby1.9.2 和 git. 多谢!

14 Floor has deleted

#1 楼 @kitt #5 楼 @sg552sg552 #7 楼 @southwolf 天际网的技术 boss 就是用的 windows,他会过去。所以大家 windows 下面的问题,可以和他讨论一下。

#11 楼 @knwang 谢谢结对的建议。

我就直接邀请那些女孩参考这个帖子安装好了~ 欢迎大家在此处答疑。

写了个简单的 win 下的本地环境配置 只包括 railsinstaller 与 sublime

Setup for Windows

下载并运行 railsinstaller-2.1.0.exe(http://pan.baidu.com/share/link?shareid=139731&uk=288070325)。一路点击默认选项即可完成安装。 您还需要用于编辑代码文件的文本编辑器。在本工作室环境下我们推荐使用免费软件 Sublime Text 2 • 安装 Sublime Text 2(http://pan.baidu.com/share/link?shareid=139733&uk=288070325) 我们现在应该拥有一个完备的 Ruby on Rails 编程环境啦,祝贺你!

run railsinstaller-2.1.0.exe(http://pan.baidu.com/share/link?shareid=139731&uk=288070325). Click through the installer using the default options. You also need a text editor to edit code files. For the workshop we recommend the text editor Sublime Text. • Install Sublime Text 2(http://pan.baidu.com/share/link?shareid=139733&uk=288070325) Now you should have a working Ruby on Rails programming setup. Congrats!

写了个简单的 mac 下的本地环境配置 不包括 git 与 heroku

第一步 下载 macenv.zip(http://pan.baidu.com/share/link?shareid=139736&uk=288070325),双击它,它会解压在当前目录 第二步 下载并安装 GCC-10.7-v2.pkg 第三步 安装完毕后,打开 Terminal.app. 点击 Spotlight (右上角的放大镜图标), 键入 Terminal.app 并选择 第四步。下载并安装 RailsInstaller-1.0.3-osx-10.7(http://pan.baidu.com/share/link?shareid=139737&uk=288070325) 如果一切顺利,我们现在应该拥有一个完备的 Ruby on Rails 编程环境啦,祝贺你! 最后一步 安装用于编辑代码文件的文本编辑器。在本工作室环境下我们推荐使用免费软件 Komodo Edit。 • 下载 Sublime Text 2 并安装

Step 1. Download macenv.zip(http://pan.baidu.com/share/link?shareid=139736&uk=288070325) and it will unpack it into the current directory. Step 2. Double click the the newly unpacked ‘GCC-10.7-v2.pkg’ and follow the instructions. Please ignore the instructions in this file. Step 2. Double click the the newly unpacked ‘RailsInstaller-1.0.3-osx-10.7.app’ and follow the instructions. It will open a README file with ‘Rails Installer OS X’ at the top. Please ignore the instructions in this file. Final step. Install a text editor to edit code files. For the workshop we recommend the text editor Sublime Text. • Download Sublime Text 2 and install it(http://pan.baidu.com/share/link?shareid=139737&uk=288070325) Now you should have a working Ruby on Rails programming setup. Congrats!

#18 楼 @freebird0221 谢谢马乐同学 #13 楼 @southwolf 宋飞同学,麻烦你完善一下帖子。最近应该会有不少 girls 加入 ruby-china.

然后最好有人翻译一下,因为我们这次活动有外国 girls 和 tutors.

我原来开发组里有用 windows 做 RoR 项目的。他们遇到很多麻烦。包括 source control, unit test, deployment 等等问题。有的 GEM 在 windows 下根本就不能用。他们不得不 monkey patching。

我建议在可能的情况下,最好还是在 Unix like 的环境下 RoR 项目。

You need to Sign in before reply, if you don't have an account, please Sign up first.