prototypejs / prototype

Prototype JavaScript framework
http://prototypejs.org/
Other
3.54k stars 639 forks source link

use "rake dist" build error : ArgumentError: invalid byte sequence in GBK #290

Closed jx0260 closed 9 years ago

jx0260 commented 9 years ago

I use "rake dist" to build, the result print as shown below:

G:\frontEnd-JS\prototype>rake dist
rake aborted!
ArgumentError: invalid byte sequence in GBK
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/source_line.rb:28:in `begins_pdoc_comment?'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/source_file.rb:19:in `block (2 levels) in source_lines'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/source_file.rb:16:in `each'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/source_file.rb:16:in `block in source_lines'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/source_file.rb:15:in `open'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/source_file.rb:15:in `source_lines'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/source_file.rb:37:in `each_source_line'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/preprocessor.rb:17:in `require'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/preprocessor.rb:37:in `require_from_source_line'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/preprocessor.rb:19:in `block in require'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/source_file.rb:37:in `each'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/source_file.rb:37:in `each_source_line'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/preprocessor.rb:17:in `require'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/preprocessor.rb:37:in `require_from_source_line'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/preprocessor.rb:19:in `block in require'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/source_file.rb:37:in `each'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/source_file.rb:37:in `each_source_line'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/preprocessor.rb:17:in `require'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/secretary.rb:43:in `block in add_source_files'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/secretary.rb:41:in `each'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/secretary.rb:41:in `add_source_files'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/secretary.rb:23:in `reset!'
G:/frontEnd-JS/prototype/vendor/sprockets/lib/sprockets/secretary.rb:14:in `initialize'
G:/frontEnd-JS/prototype/Rakefile:63:in `new'
G:/frontEnd-JS/prototype/Rakefile:63:in `sprocketize'
G:/frontEnd-JS/prototype/Rakefile:245:in `block in <top (required)>'
Tasks: TOP => dist

I opened the file "sprockets/source_line.rb" line 28: 27 def begins_pdoccomment? 28 line =~ /^\s\/_(.)/ 29 end I didn't find any thing special. I searched around the google, but can't resolve it. Besides, I've run the cmd "git submodule init" and "git submodule update"

my environment: win7 sys.

G:\frontEnd-JS\prototype>gem -v
2.4.5
G:\frontEnd-JS\prototype>rake -V
rake, version 10.4.2
ruby 2.2.1p85
jwestbrook commented 9 years ago

Which version of ruby?

jx0260 commented 9 years ago

ruby 2.2.1p85

jwestbrook commented 9 years ago

I just installed 2.2.1 from RubyInstaller and was able to run rake dist - there is a possibility that you have a conflicting version of sprockets installed globally.

gem list will list all the global ruby gems and if sprockets is on there it might need to be removed before prototype will build.

savetheclocktower commented 9 years ago

Closing for now; @jx0260, if you can't get it to work, re-open this ticket and we'll figure it out.