rake预编译失败,没有这样的文件或目录

时间:2014-09-03 09:08:47

标签: ruby-on-rails ruby-on-rails-3.1

每当我尝试执行rake资产时,我一直遇到以下错误:在我的rails应用程序中预编译。

我不知道从哪里开始=(

错误指向

Errno :: ENOENT:没有这样的文件或目录 - / Users / victor / workspace / vendor

但是我没有编写任何代码来指向该特定目录。所以我不确定发生了什么。

** Invoke assets:precompile (first_time)ssets:precompile --trace RAILS_ENV=development
** Execute assets:precompile
/Users/victor/.rvm/rubies/ruby-1.9.3-p547/bin/ruby /Users/victor/.rvm/gems/ruby-1.9.3-p547@global/bin/rake assets:precompile:all RAILS_ENV=development RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
Errno::ENOENT: No such file or directory - /Users/victor/workspace/vendor
  (in /Users/victor/workspace/Xfers/app/assets/stylesheets/application.css.scss)
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sass-3.4.2/lib/sass/util.rb:670:in `realpath'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sass-3.4.2/lib/sass/util.rb:670:in `realpath'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sass-3.4.2/lib/sass/util.rb:670:in `realpath'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sass-3.4.2/lib/sass/importers/filesystem.rb:16:in `initialize'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sass-3.4.2/lib/sass/engine.rb:192:in `new'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sass-3.4.2/lib/sass/engine.rb:192:in `block in normalize_options'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sass-3.4.2/lib/sass/engine.rb:190:in `map'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sass-3.4.2/lib/sass/engine.rb:190:in `normalize_options'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sass-3.4.2/lib/sass/engine.rb:256:in `initialize'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sass-rails-3.2.6/lib/sass/rails/template_handlers.rb:106:in `new'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sass-rails-3.2.6/lib/sass/rails/template_handlers.rb:106:in `evaluate'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `each'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `evaluate'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/processed_asset.rb:12:in `initialize'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:249:in `new'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:249:in `block in build_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:270:in `circular_call_protection'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:248:in `build_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/bundled_asset.rb:16:in `initialize'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `new'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `build_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/environment.rb:78:in `find_asset'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:19:in `block in compile'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `block in each_logical_path'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:18:in `compile'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.13/lib/sprockets/assets.rake:56:in `internal_precompile'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.13/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/victor/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.13/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/victor/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/bin/rake:23:in `load'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/Users/victor/.rvm/rubies/ruby-1.9.3-p547/...]
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/file_utils.rb:55:in `block in create_shell_runner'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/file_utils.rb:45:in `call'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/file_utils.rb:45:in `sh'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/file_utils_ext.rb:37:in `sh'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/file_utils.rb:82:in `ruby'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/file_utils_ext.rb:37:in `ruby'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/victor/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/bin/rake:23:in `load'
/Users/victor/.rvm/gems/ruby-1.9.3-p547@global/bin/rake:23:in `<main>'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/bin/ruby_executable_hooks:15:in `eval'
/Users/victor/.rvm/gems/ruby-1.9.3-p547/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => assets:precompile

1 个答案:

答案 0 :(得分:0)

当Rails为您的应用程序预编译资产时,它会在资产的三个不同目录中查找app/assets(针对此应用程序特定的资产),lib/assets(对于内部库)和{{1} (对于第三方库和资产)。通常在生成Rails应用程序时创建vendor/assets目录。

尝试在应用程序中创建一个空的vendor/assets目录,然后再次运行预编译,看看会发生什么。