在全新安装上运行rails或rake命令时出错

时间:2011-10-15 14:21:07

标签: ruby-on-rails macos

昨天买的macbook air。安装了自制软件,xcode,rails,git,克隆了我的项目。运行“rails s”或rake db:create,rake db:migrate等都返回同样的错误。已经运行捆绑安装。看起来很奇怪,可能需要重新安装,但我应该重新安装什么?

/Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require': /Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:31: odd number list for Hash (SyntaxError)
        title: @meta_title,
              ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:31: syntax error, unexpected ':', expecting '}'
        title: @meta_title,
              ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:32: syntax error, unexpected ':', expecting '='
        keywords: @meta_keywords,
                 ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:33: syntax error, unexpected ':', expecting '='
        description: @meta_description,
                    ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:34: syntax error, unexpected ':', expecting '='
        author: @meta_author,
               ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:35: syntax error, unexpected ':', expecting '='
        email: @meta_email,
              ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:36: syntax error, unexpected ':', expecting '='
        copyright: @meta_copyright,
                  ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:37: syntax error, unexpected ':', expecting '='
        generator: @meta_generator,
                  ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:38: syntax error, unexpected ':', expecting '='
        rating: @meta_rating,
               ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:39: syntax error, unexpected ':', expecting '='
        language: @meta_language,
                 ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:40: syntax error, unexpected ':', expecting '='
        distribution: @meta_distribution,
                     ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:41: syntax error, unexpected ':', expecting '='
        robots: @robots,
               ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:42: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
        :"fb:app_id" => @meta_fb_app_id,
                       ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:43: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
        :"og:title" => @meta_og_title,
                      ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:44: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
        :"og:description" => @meta_og_description,
                            ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:45: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
        :"og:url" => request.url,
                    ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:46: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
        :"og:site_name" => @meta_og_site_name,
                          ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:47: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
        :"og:type" => @meta_og_type,
                     ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:48: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
        :"og:image" => @meta_og_image,
                      ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:49: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
        :"og:locality" => @meta_og_locality,
                         ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:50: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
        :"og:region" => @meta_og_region,
                       ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:51: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
        :"og:country_name" => @meta_og_country_name,
                             ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:52: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
        :"og:phone_number" => @meta_og_phone_number
                             ^
/Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers/metatag_helper.rb:58: syntax error, unexpected $end, expecting kEND
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
    from /Library/Ruby/Gems/1.8/gems/frontend-helpers-0.0.7/lib/frontend-helpers.rb:2
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
    from /Users/davidganly/work/vvx/config/application.rb:13
    from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/commands.rb:52:in `require'
    from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/commands.rb:52
    from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/commands.rb:49:in `tap'
    from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/commands.rb:49
    from script/rails:6:in `require'
    from script/rails:6

2 个答案:

答案 0 :(得分:0)

我没有红宝石1.9.2。 - 只是没有注意到。无论如何,做了明智的事情并通过rvm安装,现在一切都正常运行。

答案 1 :(得分:0)

如果我之前的答案被删除了,因为如果我无法更新到1.9.x,我会问我应该怎么做,因为接受的答案不会真的解决问题。< / p>

顺便说一下,我向frontend-helpers提交了一个补丁,现在它已合并为master:

https://github.com/christopherhein/frontend-helpers/commit/b2ce595d2dd183b643fbe4c3c22cd9defbc24ed7

因此,如果您遇到此问题,只需升级您的Gemfile!