1

在安装了以下工具的 Mac OS X 系统 (10.8.2) 上:

  • Ruby,1.9.3p362(2012-12-25 修订版 38607)[x86_64-darwin12.2.0],通过 brew
  • 捆绑器,1.2.3 通过gem install bundler
  • 耙子,10.0.3 通过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会安装 gems 列表,但最后会要求输入管理员密码并报告成功。#emberjs 的一个想法是,这意味着它将 gems 安装到我的系统中,而不是沙盒环境中,这才真正的问题。

可以做些什么来克服这个 bundle/rake 错误?

4

1 回答 1

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
于 2013-01-09T20:36:50.257 回答