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

Building ember.js fails on OS X 10.8.2

本文关键字:构建 ember js 失败 OS      更新时间:2023-09-26

在安装了这些工具的Mac OS X系统上:

  • Ruby, 1.9.3p362 (2012-12-25 revision 38607) [x86_64-darwin12.2.0], via brew
  • Bundler, 1.2.3 via 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,似乎你需要先运行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错误?

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

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