2017-01-04 7 views
11

번들링 과정에서 Ruby 2.4.0을 사용하도록 내 App을 업그레이드했습니다. 내 서버를 시작하려고 할 때, 그러나, 나는 다음과 같은 오류 얻을 : 나는 당신이 당신의 Gemfile에 gem 'therubyracer'를 추가 할 필요가이 사이트에 다른 답변에서 발견Ruby 2.4 업그레이드 후 'uglifier'(Bundler :: GemRequireError)를로드하는 중 오류가 발생했습니다.

There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError) 
Gem Load Error is: wrong argument type Class (expected Module) 

,하지만 난 이미 생성 이후 그 있었다 내 앱의

최신 버전의 NodeJS도 내 컴퓨터에 설치됩니다.

누구든지이 오류가 발생하여 해결 방법을 알고 있습니까? Gemfile에

uglifier 구성 : gem 'uglifier', '~> 3.0.4'

전체 스택 추적 :

/home/severin/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated 
/home/severin/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated 
/home/severin/.rvm/gems/ruby-2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:21: warning: constant ::Fixnum is deprecated 
/home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError) 
Gem Load Error is: wrong argument type Class (expected Module) 
Backtrace for gem load error is: 
/home/severin/.rvm/gems/ruby-2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:23:in `include' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:23:in `block (2 levels) in <top (required)>' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:22:in `class_eval' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:22:in `block in <top (required)>' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:21:in `each' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/therubyracer-0.12.2/lib/v8/conversion.rb:21:in `<top (required)>' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/therubyracer-0.12.2/lib/v8.rb:22:in `require' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/therubyracer-0.12.2/lib/v8.rb:22:in `<top (required)>' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:108:in `require' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:108:in `available?' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:63:in `each' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:63:in `find' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:63:in `best_available' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:57:in `autodetect' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/uglifier-3.0.4/lib/uglifier.rb:5:in `require' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/uglifier-3.0.4/lib/uglifier.rb:5:in `<top (required)>' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `require' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `block (2 levels) in require' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `each' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `block in require' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `each' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `require' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler.rb:106:in `require' 
/home/config/application.rb:7:in `<top (required)>' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:88:in `require' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:88:in `block in server' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `server' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in `<top (required)>' 
/home/bin/rails:9:in `require' 
/home/bin/rails:9:in `<top (required)>' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `load' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `call' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/lib/spring/client/command.rb:7:in `call' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/lib/spring/client.rb:30:in `run' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/bin/spring:49:in `<top (required)>' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `load' 
/home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `<top (required)>' 
/home/severin/bin/spring:13:in `require' 
/home/severin/bin/spring:13:in `<top (required)>' 
bin/rails:3:in `load' 
bin/rails:3:in `<main>' 
Bundler Error Backtrace: 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:90:in `block (2 levels) in require' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `each' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `block in require' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `each' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `require' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler.rb:106:in `require' 
    from /home/severin/config/application.rb:7:in `<top (required)>' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:88:in `require' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:88:in `block in server' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `server' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in `<top (required)>' 
    from /home/severin/bin/rails:9:in `require' 
    from /home/severin/bin/rails:9:in `<top (required)>' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `load' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `call' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/lib/spring/client/command.rb:7:in `call' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/lib/spring/client.rb:30:in `run' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/bin/spring:49:in `<top (required)>' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `load' 
    from /home/severin/.rvm/gems/ruby-2.4.0/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `<top (required)>' 
    from /home/severin/bin/spring:13:in `require' 
    from /home/severin/bin/spring:13:in `<top (required)>' 
    from bin/rails:3:in `load' 
    from bin/rails:3:in `<main>' 
+0

명령 번들 업데이트를 실행 한 다음 다시 시도하십시오. –

+0

@Bhatsoni 그게 내가 시도한 첫 번째 일 이었어. – Severin

+0

어떤 OS를 호기심에서 사용하고 있습니까? 나는이 보석을 windows10에서 실행하려고 할 때 문제가 발생했습니다. – Brad

답변

15

이것은 uglifier 저장소에 열려 문제 : Uglifier doesn't load with Ruby 2.4.0 using The Ruby Racer JS runtime.

Ruby 2.4.0에서 unification of Fixnum and Bignum into Integer으로 인한 것입니다. Here은 문제를 해결하는 끌어 오기 요청이며 실제로 therubyracer이 아니며 uglifier이 아닙니다.

gem 'therubyracer', git: 'https://github.com/cowboyd/therubyracer.git' 

업데이트 : 지금 released을하고있다 0.12.3therubyracer 버전, 위의 수정을 포함

는 지금, 임시 수정 프로그램으로, 당신은 REPO의 마스터 분기를 사용하도록 Gemfile을 구성 할 수 있습니다 루비 2.4 지원.

+0

Thx, 저에게 문제를 해결했습니다. – Severin