首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > Ruby Rails >

请问一个rails的有关问题

2012-02-25 
请教一个rails的问题http://guides.rubyonrails.org/getting_started.html上面的链接是rails官方网站的入

请教一个rails的问题
http://guides.rubyonrails.org/getting_started.html
上面的链接是rails官方网站的入门指南,里面有个步骤是设置主页的路径:
4.3 Setting the Application Home Page
  #...
  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  root :to => "home#index"
The root :to => "home#index" tells Rails to map the root action to the home controller’s index action.
Now if you navigate to http://localhost:3000 in your browser, you’ll see Hello, Rails!.
我按照上面的设置后,输入URL却得到错误的返回信息如下,我用的ruby1.9.2和rails3.1版本,网上找了一下也没有找到最终的解决办法,还请高手指点指点怎么解决这个问题:
ExecJS::RuntimeError in Home#index

Showing E:/RailsProject/blog/app/views/layouts/application.html.erb where line #6 raised:


  (in E:/RailsProject/blog/app/assets/javascripts/home.js.coffee)
Extracted source (around line #6):

3: <head>
4: <title>Blog</title>
5: <%= stylesheet_link_tag "application" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
9: <body>
Rails.root: E:/RailsProject/blog

Application Trace | Framework Trace | Full Trace
app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___662510408_38938560'
Request

Parameters:

None
Show session dump

Show env dump

GATEWAY_INTERFACE: "CGI/1.1"
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_ACCEPT_CHARSET: "ISO-8859-1,utf-8;q=0.7,*;q=0.3"
HTTP_ACCEPT_ENCODING: "gzip,deflate,sdch"
HTTP_ACCEPT_LANGUAGE: "en-US,en;q=0.8"
REMOTE_ADDR: "127.0.0.1"
REMOTE_HOST: "chenhui-PC"
SERVER_NAME: "localhost"
SERVER_PROTOCOL: "HTTP/1.1"
Response

Headers:

None


[解决办法]
是js被拒绝访问的问题,你的电脑上是不是安装了360防火墙,在第一次访问http://localhost:3000时,360会弹出对话框询问是否执行JS脚本,如果你选择了拒绝或者默认拒绝,那么就会出现上述错误。
[解决办法]
你检查一下IE的设置中是否禁止了JS。

热点排行