2

不知何故,这是相关的,但我不确定如何/为什么?

刚刚通过 RVM 的命令从 Ruby 1.9.2-p180 升级到 1.9.2-p290 rvm upgrade……现在我的资产管道已经“损坏”了。

在此期间rvm upgrade ...,我注意到每个 gemset 存在以下错误:

ERROR: Error running 'rvm gemset pristine' under ,
please read /Users/meltemi/.rvm/log//gemset.pristine.log

我让升级继续,因为 gemset.pristine.log 中没有太多有趣的东西......此外,/Users/meltemi/.rvm/log//gemset.pristine.log不(不能?)存在于那个确切的路径中吗?路径名中有两个连续的“//”?反正...

测试一个小型应用程序,尽管它启动并似乎运行它并没有加载任何资产(图像、css 等)。开发日志有很多Not Found关于这些缺失资产的错误(见下文),即使它们存在于app/assets/imagesandapp/assets/stylesheets等...?

有人知道这里发生了什么吗?似乎管道已经以某种方式崩溃了......好像 Rails 不再知道在应用程序/资产中寻找资产,也许?我如何测试/验证/修复/重新激活这个“管道”?

$ rails s
=> Booting WEBrick
=> Rails 3.1.0.rc4 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-07-25 23:11:38] INFO  WEBrick 1.3.1
[2011-07-25 23:11:38] INFO  ruby 1.9.2 (2011-07-09) [x86_64-darwin10.8.0]
[2011-07-25 23:11:38] INFO  WEBrick::HTTPServer#start: pid=74881 port=3000


Started GET "/" for 127.0.0.1 at 2011-07-25 23:11:43 -0700
  Processing by PostsController#index as HTML
  Post Load (0.2ms)  SELECT "posts".* FROM "posts" ORDER BY posts.created_at DESC
  User Load (0.3ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  Photo Load (0.3ms)  SELECT "photos".* FROM "photos" WHERE "photos"."post_id" = 6
  CACHE (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  Photo Load (0.2ms)  SELECT "photos".* FROM "photos" WHERE "photos"."post_id" = 5
  CACHE (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  Photo Load (0.2ms)  SELECT "photos".* FROM "photos" WHERE "photos"."post_id" = 4
  CACHE (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  Photo Load (0.2ms)  SELECT "photos".* FROM "photos" WHERE "photos"."post_id" = 2
  CACHE (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  Photo Load (0.2ms)  SELECT "photos".* FROM "photos" WHERE "photos"."post_id" = 1
Rendered posts/index.html.haml within layouts/application (3016.4ms)
Rendered layouts/_header.html.haml (9.7ms)
Completed 200 OK in 3143ms (Views: 3138.2ms | ActiveRecord: 2.9ms)


Started GET "/assets/application.css" for 127.0.0.1 at 2011-07-25 23:11:47 -0700
Served asset /application.css - 404 Not Found (1ms)

ActionController::RoutingError (No route matches [GET] "/assets/application.css"):


Rendered /Users/meltemi/.rvm/gems/ruby-1.9.2-p290@rails3/gems/actionpack-3.1.0.rc4/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.2ms)


Started GET "/assets/application.js" for 127.0.0.1 at 2011-07-25 23:11:47 -0700
Served asset /application.js - 404 Not Found (0ms)

ActionController::RoutingError (No route matches [GET] "/assets/application.js"):


Rendered /Users/meltemi/.rvm/gems/ruby-1.9.2-p290@rails3/gems/actionpack-3.1.0.rc4/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.8ms)


Started GET "/assets/racer-outline.png" for 127.0.0.1 at 2011-07-25 23:11:48 -0700
Served asset /racer-outline.png - 404 Not Found (0ms)

ActionController::RoutingError (No route matches [GET] "/assets/racer-outline.png"):


Rendered /Users/meltemi/.rvm/gems/ruby-1.9.2-p290@rails3/gems/actionpack-3.1.0.rc4/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (3.2ms)


Started GET "/assets/ray.png" for 127.0.0.1 at 2011-07-25 23:11:48 -0700
Served asset /pogo.png - 404 Not Found (0ms)

ActionController::RoutingError (No route matches [GET] "/assets/ray.png"):


Rendered /Users/meltemi/.rvm/gems/ruby-1.9.2-p290@rails3/gems/actionpack-3.1.0.rc4/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.2ms)
4

2 回答 2

4

sprockets 的 2.0.0.beta.11 版本似乎破坏了资产管道。推杆

宝石'链轮','= 2.0.0.beta.10'

进入您的 Gemfile 似乎可以解决问题(它对我有用)。无论出于何种原因,Rails 似乎都会自动使用最新版本的 beta 版本,因此如果您最近刚刚开始您的项目或更新了所有 gem,它可能会破坏它。

请注意,此信息最初不是我的,我从http://groups.google.com/group/rubyonrails-core/browse_thread/thread/59d8c7813b4d1bbe?pli=1获得了修复

他解释了版本的问题。2.0.0.beta.11 但我使用的是版本。2.0.0.beta.12 具有相同的结果,所以他们似乎还没有修复它。

编辑:似乎将您的 rails 升级到 3.1.rc5 也可以解决问题

于 2011-08-02T18:15:49.843 回答
0

我最终只是吹掉了整个有问题的宝石集并重新开始。学过的知识:

不要相信rvm upgrade。在 RVM 中安装新的 Ruby。然后手动重建(或bundle install)您的 gemsets。

于 2011-07-26T18:55:35.510 回答