无法在OSX Leopard上安装therubyracer,gcc版本更新?

时间:2013-02-02 03:36:56

标签: ruby-on-rails macos gcc osx-leopard therubyracer

所以在使用Rails制作我的第一个脚手架之后,我试图访问它创建的一些页面,并得到以下错误:

     ExecJS::RuntimeError in Users#index

     Showing /Users/Alice/Desktop/sample_app/app/views/layouts/application.html.erb where line #6 raised:

     dyld: unknown required load command 0x80000022

     (in /Users/Alice/Desktop/sample_app/app/assets/javascripts/users.js.coffee)
     Extracted source (around line #6):

     3: <head>
     4:   <title>SampleApp</title>
     5:   <%= stylesheet_link_tag    "application", :media => "all" %>
     6:   <%= javascript_include_tag "application" %>
     7:   <%= csrf_meta_tags %>
     8: </head>
     9: <body></code>

我查了一下这个错误,我得出结论,我需要安装therubyracer gem。我试图通过gem install therubyracer来做到这一点。

然后我收到了错误:

    ERROR:  Error installing therubyracer:
    ERROR: Failed to build gem native extension.
    /Users/Alice/.rvm/rubies/ruby-1.9.3-p362/bin/ruby extconf.rb
    creating Makefile
    Unable to find a compiler officially supported by v8.
    It is recommended to use GCC v4.4 or higher
    Using compiler: g++
    File "./gyp-mac-tool", line 167
    fd = os.open(lockfile, os.O_RDONLY|os.O_NOCTTY|os.O_CREAT, 0o666)
                                                               ^
    SyntaxError: invalid syntax

所以我运行gcc -version,我看到我的版本是i686-apple-darwin9-gcc-4.0.1 我试图使用MacPorts更新我的gcc,而我似乎无法使其完全正常工作......

我正在运行OSX Leopard,我猜这是我悲伤的原因 我该怎么办?

1 个答案:

答案 0 :(得分:0)

尝试另一个。 https://github.com/sstephenson/execjs 看看清单,这些基本上都做同样的事情。我确定你会发现一个有效的。