Middleman服务器无法启动,regexp内部无效

时间:2013-11-12 22:10:53

标签: ruby middleman

我已经移动了托管服务提供商并重新安装了ruby和中间人。

当我运行bundle exe middleman server时,我得到:

  

/var/lib/gems/1.8/gems/haml-4.0.4/lib/haml/parser.rb:86:警告:regexp的间隔无效   /var/lib/gems/1.8/gems/middleman-s3_sync-3.0.21/lib/middleman-s3_sync.rb:2:in require': /var/lib/gems/1.8/gems/middleman-s3_sync-3.0.21/lib/middleman/s3_sync.rb:54: syntax error, unexpected ':', expecting ')' (SyntaxError) @progress_bar ||= ProgressBar.create(total: paths.length) ^ /var/lib/gems/1.8/gems/middleman-s3_sync-3.0.21/lib/middleman/s3_sync.rb:54: syntax error, unexpected ')', expecting kEND /var/lib/gems/1.8/gems/middleman-s3_sync-3.0.21/lib/middleman/s3_sync.rb:67: syntax error, unexpected '.', expecting kEND ... .reject { |p| File.directory?(p... ^ /var/lib/gems/1.8/gems/middleman-s3_sync-3.0.21/lib/middleman/s3_sync.rb:137: syntax error, unexpected $end, expecting kEND from /var/lib/gems/1.8/gems/middleman-s3_sync-3.0.21/lib/middleman-s3_sync.rb:2 from /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in需要”       来自/var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in require' from /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in每个'       来自/var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in require' from /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in每个'       from /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in require' from /var/lib/gems/1.8/gems/bundler-1.3.5/lib/bundler.rb:132:in require'       来自/var/lib/gems/1.8/gems/middleman-core-3.2.0/lib/middleman-core/load_paths.rb:38:in setup_load_paths' from /var/lib/gems/1.8/gems/middleman-core-3.2.0/bin/middleman:10 from /usr/local/bin/middleman:19:in load'       来自/ usr / local / bin / middleman:19

我的Ruby知识很差,但是当我查看代码时,我没有看到语法错误。我看了一下s3_sync git hub代码,这部分代码在一段时间内没有改变。我怀疑这是一个编码问题,但是我试图修复它有点困难。任何你能摆脱的光线都会非常有帮助。

其他信息:我已经尝试过Ruby 1.8和1.9.3。这是在Ubuntu 12.04上。

1 个答案:

答案 0 :(得分:1)

SyntaxError似乎在Middleman中抱怨这个:

ProgressBar.create(total: paths.length)

/var/lib/gems/1.8/路径表示您正在使用Ruby 1.8.X.但是JavaScript风格的哈希表示法:

total: paths.length

在1.8中不起作用,你必须在那里使用:total => paths.length表示法。看起来你不能使用1.8.7的那个版本的Middleman,要么升级到1.9.3+,要么将你的Middleman降级为适用于旧版Rubies的东西。