我需要做什么才能让博客在 Rails 4.2 中工作? [英] What do I need to do to get the blog to work in rails 4.2?

查看:51
本文介绍了我需要做什么才能让博客在 Rails 4.2 中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了 rails 4.2 .我找到了制作快速博客的教程:https://www.reinteractive.net/posts/32-ruby-on-rails-3-2-blog-in-15-minutes-step-by-step .但是,它使用 rails 3.2 .在 rake db:migrate 之前,我已经完成了它所说的一切,但是,当我运行服务器时,我只是得到一个错误页面.自 3.2 以来发生了哪些变化?我现在必须做什么才能做同样的事情?

I have just installed rails 4.2 . I have found this tutorial for making a quick blog: https://www.reinteractive.net/posts/32-ruby-on-rails-3-2-blog-in-15-minutes-step-by-step . However, it uses rails 3.2 . I have done everything that it says up to rake db:migrate and yet, when I run the server, I just get an error page. What has changed since 3.2? what do I now have to do to do the same thing?

错误:'ExecJS::ProgramError in Posts#index'类型错误:对象不支持此属性或方法(在 C:/Ruby193/lib/ruby/gems/1.9.1/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee)

error: 'ExecJS::ProgramError in Posts#index' TypeError: Object doesn't support this property or method (in C:/Ruby193/lib/ruby/gems/1.9.1/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee)

顺便说一句,我什至无法按照官方的 ruby​​ on rails 教程进行操作,因为当我运行服务器时,将根更改为 root 'welcome#index' 后,我只得到一个页面未找到错误.

On a side note, I can't even follow the official ruby on rails tutorial because when I run the server, after changing the root to root 'welcome#index' , I just get a page not found error.

是否有 Rails 4.2 的教程?

Are there any tutorials for rails 4.2?

推荐答案

这里有一些信息:ExecJS::Users#index (RoR) 中的运行时错误

当我调查这个问题时,我发现在 CoffeeScript 中有一个签入,我认为这对 Windows 造成了破坏(在某些版本的 cscript 运行时下):https://github.com/jashkenas/coffeescript/blob/27d3coffeescript/blob/27d28coffeescript/blob/27d28coffeescript/blob/27d200000000000

What I found when I looked into this problem was that in CoffeeScript there's a checkin here that I think broke things for Windows (under certain versions of the cscript runtime): https://github.com/jashkenas/coffeescript/blob/28c07d30cbd2add7ee762c7d532b2c9c972e441a/lib/coffee-script/parser.js

在第 563 行,它正在执行一个 Object create(lexer) 失败并返回错误 ActionView::Template::Error (TypeError: Object does not support this property or method代码>.

On line 563 it's doing an Object create(lexer) which fails with the error ActionView::Template::Error (TypeError: Object doesn't support this property or method.

回滚到 CoffeeScript 1.8.0(在此更改之前)可以解决此问题.正如其他人在此答案和其他地方所述,使用不同的运行时也可以解决此问题.

Rolling back to CoffeeScript 1.8.0 (before this change) works around this problem. As others have stated in this answer and elsewhere, using a different runtime will workaround this problem too.

要回滚到 CoffeeScript 1.8.0,请将其添加到您的 gemfile:

To roll back to CoffeeScript 1.8.0 add this to your gemfile:

gem 'coffee-script-source', '1.8.0'

并运行这些命令:

gem update 'coffee-script-source'
bundle update 'coffee-script-source'

重启你的服务器,它应该可以工作了.

Restart your server and it should be working.

这篇关于我需要做什么才能让博客在 Rails 4.2 中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆