突然间,我在尝试进行捆绑安装时遇到以下错误。
/Users/Ken/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': /Users/Ken/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb:76: syntax error, unexpected $end, expecting keyword_end (SyntaxError)
from /Users/Ken/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Ken/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/vendor/thor/base.rb:1:in `<top (required)>'
from /Users/Ken/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Ken/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Ken/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/vendor/thor.rb:1:in `<top (required)>'
from /Users/Ken/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Ken/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Ken/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/vendored_thor.rb:6:in `<top (required)>'
from /Users/Ken/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Ken/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Ken/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/cli.rb:1:in `<top (required)>'
from /Users/Ken/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Ken/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Ken/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/bin/bundle:12:in `<main>'
答案 0 :(得分:0)
$end
是文件结尾,因此您的环境似乎已破坏,thor
内的bundler
宝石更具体。也许您应该先尝试重新安装bundler
。
gem install bundler
PS:最新版本的bundler是1.1.3。所以你可以安装它,如果你没问题(我推荐它),或者你可以使用gem install bundler -v 1.0.21
重新安装旧版本。
答案 1 :(得分:0)
神秘错误“syntax error, unexpected $end, expecting keyword_end.”
此错误意味着您在代码中的某处停止了结束。作为Ruby编译源代码,它跟踪嵌套,当它到达文件末尾($ end)时,它期望再看到一个结束关键字,但没有一个存在。