Ruby on Rails 3 教程:第 2 章第 2.2.1 节用户导览

发布于 2024-12-07 17:41:39 字数 563 浏览 2 评论 0原文

我是 Ruby on Rails 的新手,正在学习这本教程书。我使用的是 Windows Vista 并使用 Cygwin。以下是我正在运行的软件的版本:

Ruby 版本 1.9.2 (i386-cygwin) RubyGems 版本 1.8.10 机架版本1.3 Rails 版本 3.1.0 JavaScript 运行时 JScript 活动记录版本 3.1.0 行动包版本 3.1.0 活动资​​源版本3.1.0 行动邮件程序版本 3.1.0 Active Support 版本 3.1.0

在第 2.2 节的开头,我能够成功运行:($railsgeneratescaffoldUsername:stringemail:string) 和 ($rakedb:migrate)。但是当我去运行($rails server)命令并在Chrome中打开网页时,我没有看到图2.4所示的屏幕。但相反看到了这个:“Encoding::InvalidByteSequenceError in Users#index”

我看到了关于将 rake 版本从 0.9.2 切换到 0.8.7 的帖子,我尝试了这个,但它不起作用为我。现在有人还有什么我可以尝试的吗?谢谢你,尼克。

I am new to Ruby on Rails and am working through this tutorial book. I am on Windows Vista and using Cygwin. Here are the versions of the software that I am running:

Ruby version 1.9.2 (i386-cygwin)
RubyGems version 1.8.10
Rack version 1.3
Rails version 3.1.0
JavaScript Runtime JScript
Active Record version 3.1.0
Action Pack version 3.1.0
Active Resource version 3.1.0
Action Mailer version 3.1.0
Active Support version 3.1.0

In the beginning of section 2.2, I was able to successfully run: ($ rails generate scaffold User name:string email:string) and ($ rake db:migrate). But when I went to run the ($ rails server) command and opened up the webpage in Chrome, I did not see the screen shown in Fig. 2.4. But instead saw this instead: "Encoding::InvalidByteSequenceError in Users#index"

I saw the post about switching the rake version from 0.9.2 to 0.8.7 and I tried this, but it didn't work for me. Does anybody now of anything else that I can try? Thank you, Nick.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

黒涩兲箜 2024-12-14 17:41:39

我尝试过使用 Windows 7 + Cygwin 进行 Rails 学习,这真的很痛苦。我强烈建议你在虚拟机上运行linux或者进行双引导。

I've tried rails learning with Windows 7 + Cygwin and it was a real pain in the ass. I strongly recommend you to run linux on the virtual machine or make a dual-boot.

久光 2024-12-14 17:41:39

由于您使用的是 ruby​​ 1.9.2,您可以尝试在 Controller 文件的开头添加 #coding: utf-8

Since you are using ruby 1.9.2 you can try to add # coding: utf-8 at the beginning of Controller file

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文