rake资产:预编译中止

时间:2013-07-04 18:51:18

标签: ruby-on-rails ruby

我需要帮助,当我做资产时:预编译中止,显然会产生错误生成execjs。

跟踪:

    /home/rails/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
    It seems your ruby installation is missing psych (for YAML output).
    To eliminate this warning, please install libyaml and reinstall your ruby.
    ** Invoke assets:precompile (first_time)
    ** Execute assets:precompile
    /home/rails/.rvm/rubies/ruby-1.9.3-p429/bin/ruby /home/rails/.rvm/gems/ruby-1.9.3-p429/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
    /home/rails/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
    It seems your ruby installation is missing psych (for YAML output).
    To eliminate this warning, please install libyaml and reinstall your ruby.
    ** 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!

    Unexpected token: keyword (var) (line: 30831, col: 677, pos: 937101)

    Error
        at new JS_Parse_Error (<eval>:2316:10736)
        at js_error (<eval>:2316:10955)
        at croak (<eval>:2316:18665)
        at token_error (<eval>:2316:18802)
        at unexpected (<eval>:2316:18890)
        at semicolon (<eval>:2316:19363)
        at <eval>:2316:21301
        at <eval>:2316:19536
        at block_ (<eval>:2316:23936)
        at ctor.body (<eval>:2316:23570)
      (in /home/rails/pys_rails/pys/app/assets/javascripts/application.js)/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/ruby_racer_runtime.rb:34:in `rescue in block in eval'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/ruby_racer_runtime.rb:28:in `block in eval'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/ruby_racer_runtime.rb:80:in `block in lock'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/ruby_racer_runtime.rb:78:in `call'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/ruby_racer_runtime.rb:78:in `Locker'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/ruby_racer_runtime.rb:78:in `lock'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/ruby_racer_runtime.rb:27:in `eval'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/ruby_racer_runtime.rb:19:in `exec'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/uglifier-2.1.1/lib/uglifier.rb:176:in `really_compile'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/uglifier-2.1.1/lib/uglifier.rb:100:in `compile'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/compressors.rb:74:in `compress'

    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processing.rb:265:in `block in js_compressor='
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `call'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `evaluate'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `each'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `evaluate'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/bundled_asset.rb:26:in `initialize'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `new'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `build_asset'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:19:in `block in compile'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `block in each_logical_path'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
    /home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:18:in `compile'

/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:56:in `internal_precompile'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/home/rails/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/home/rails/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/home/rails/.rvm/gems/ruby-1.9.3-p429/bin/rake:19:in `load'
/home/rails/.rvm/gems/ruby-1.9.3-p429/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/home/rails/.rvm/rubies/ruby-1.9.3-p429/bi...]
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/file_utils.rb:55:in `block in create_shell_runner'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/file_utils.rb:45:in `call'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/file_utils.rb:45:in `sh'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/file_utils_ext.rb:37:in `sh'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/file_utils.rb:82:in `ruby'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/file_utils_ext.rb:37:in `ruby'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/home/rails/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/home/rails/pys_rails/pys/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/home/rails/.rvm/gems/ruby-1.9.3-p429/bin/rake:19:in `load'
/home/rails/.rvm/gems/ruby-1.9.3-p429/bin/rake:19:in `<main>'
/home/rails/.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `eval'
/home/rails/.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => assets:precompileis aborted with an error generating execjs apparently.

的Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'

#Javascript
gem 'execjs'
#gem 'therubyracer'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails', "2.3.0"

#Fotos
gem 'rmagick'
gem 'carrierwave'
gem 'jquery-fileupload-rails'

#Video
gem 'paperclip'
gem 'paperclip-ffmpeg'

#Panel administración
gem 'activeadmin'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

gem 'passenger'

我从rvm安装了rails 3.2.13和ruby 1.9.3。

请帮忙! THX

1 个答案:

答案 0 :(得分:0)

To eliminate this warning, please install libyaml and reinstall your ruby.

指出你试试这个

rvm reinstall 1.9.3 --with-libyaml
rvm use 1.9.3 #just to check.
gem install psych