在OS X 10.8.2上构建ember.js失败

时间:2013-01-09 07:27:43

标签: javascript rake ember.js bundler

在Mac OS X系统(10.8.2)上安装了这些工具:

  • Ruby,1.9.3p362(2012-12-25 revision 38607)[x86_64-darwin12.2.0],bre​​w brew
  • Bundler,1.2.3来自gem install bundler
  • rake,10.0.3 via gem install rake

无法从源代码构建Ember。以下是运行rake dist时的错误日志:

± ~/dev/ember.js (master ✓) ⚡ rake dist
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25: warning: redundant nested repeat operator
rake aborted!
cannot load such file -- bundler/setup
/Users/foo/dev/ember.js/Rakefile:3:in `<top (required)>'
(See full trace by running task with --trace)

± ~/dev/ember.js (master ✓) ⚡ rake dist --trace
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25: warning: redundant nested repeat operator
rake aborted!
cannot load such file -- bundler/setup
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/foo/dev/ember.js/Rakefile:3:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load'
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:583:in `raw_load_rakefile'
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:89:in `block in load_rakefile'
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:88:in `load_rakefile'
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:72:in `block in run'
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p362/bin/rake:23:in `load'
/usr/local/Cellar/ruby/1.9.3-p362/bin/rake:23:in `<main>'

通过查看#emberjs中的Ember Data构建说明和讨论,您似乎需要先运行bundle。这样做成功安装了一些捆绑包,尽管最后会提示输入管理员密码“将捆绑的RubyGems安装到您的系统中”。

如果您随后运行此命令以查看安装了哪些gem,您可以看到一个gem特别拒绝安装。按照建议运行bundle install并不能解决这个问题。

± ~/dev/ember.js (master ✓) ⚡ bundle exec rake -T
https://github.com/pangratz/github_downloads.git (at master) is not checked out. Please run `bundle install`

Twitter的建议是运行bundle rake dist。这会产生:

± ~/dev/ember.js (master ✓) ⚡ bundle rake dist
Could not find task "rake".

另一个bundle exec rake dist

± ~/dev/ember.js (master ✓) ⚡ bundle exec rake dist
https://github.com/pangratz/github_downloads.git (at master) is not checked out. Please run `bundle install`

此时运行bundle install会安装宝石列表,但会在最后请求管理员密码并报告成功。 #emberjs的一个想法是,这意味着它将宝石安装到我的系统而不是沙盒环境中,并且 是真正的问题。

如何克服此捆绑/耙错误?

1 个答案:

答案 0 :(得分:1)

这是一个对我有用的解决方案:

cd <your ember clone>
curl -L https://get.rvm.io | bash -s stable --ruby
rvm install 1.9.3
rvm use 1.9.3
rvm rubygems latest
bundle install
rake dist