我对 ruby 完全陌生,并且一直在使用一个教程来指导我将一些 gem 添加到我的项目的 Gemfile 中。宝石文件:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :test, :development do
gem 'turn'
gem 'rspec-rails'
gem 'capybara'
gem 'guard-rspec'
gem 'growl_notify'
end
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
然后我继续我的终端,运行 bundle install 并得到了一堆错误。很多,所以我不想全部添加,但我会添加一些。
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
creating Makefile
make
compiling src/rbae.c
src/rbae.c:13:27: error: Carbon/Carbon.h: No such file or directory
src/rbae.c:14:43: error: CoreFoundation/CoreFoundation.h: No such file or directory
In file included from src/rbae.c:15:
src/SendThreadSafe.h:73:53: error: ApplicationServices/ApplicationServices.h: No such file or directory
In file included from src/rbae.c:15:
src/SendThreadSafe.h:125: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘SendMessageThreadSafe’
src/rbae.c:24: error: expected specifier-qualifier-list before ‘AEDesc’
src/rbae.c:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘upp_GenericEventHandler’
src/rbae.c:39: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘upp_GenericCoercionHandler’
src/rbae.c:61: error: expected declaration specifiers or ‘...’ before ‘OSErr’
src/rbae.c: In function ‘rbAE_raiseMacOSError’:
src/rbae.c:66: error: ‘number’ undeclared (first use in this function)
src/rbae.c:66: error: (Each undeclared identifier is reported only once
src/rbae.c:66: error: for each function it appears in.)
src/rbae.c: At top level:
src/rbae.c:89: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rbStringToDescType’
src/rbae.c:99: error: expected ‘)’ before ‘descType’
src/rbae.c: In function ‘rbAE_freeAEDesc’:
src/rbae.c:112: warning: implicit declaration of function ‘AEDisposeDesc’
src/rbae.c:112: error: ‘struct rbAE_AEDescWrapper’ has no member named ‘desc’
src/rbae.c: At top level:
src/rbae.c:117: warning: type defaults to ‘int’ in declaration of ‘AEDesc’
src/rbae.c:117: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
src/rbae.c:138: warning: type defaults to ‘int’ in declaration of ‘AEDesc’
src/rbae.c:138: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
src/rbae.c: In function ‘rbAE_AEDesc_new’:
src/rbae.c:153: error: ‘OSErr’ undeclared (first use in this function)
src/rbae.c:153: error: expected ‘;’ before ‘err’
src/rbae.c:154: error: ‘AEDesc’ undeclared (first use in this function)
src/rbae.c:154: error: expected ‘;’ before ‘desc’
src/rbae.c:157: error: ‘err’ undeclared (first use in this function)
src/rbae.c:157: warning: implicit declaration of function ‘AECreateDesc’
src/rbae.c:157: warning: implicit declaration of function ‘rbStringToDescType’
src/rbae.c:159: error: ‘desc’ undeclared (first use in this function)
src/rbae.c:160: error: ‘noErr’ undeclared (first use in this function)
src/rbae.c:160: error: too many arguments to function ‘rbAE_raiseMacOSError’
src/rbae.c:161: warning: implicit declaration of function ‘rbAE_wrapAEDesc’
src/rbae.c: In function ‘rbAE_AEDesc_newList’:
src/rbae.c:168: error: ‘OSErr’ undeclared (first use in this function)
src/rbae.c:168: error: expected ‘;’ before ‘err’
src/rbae.c:169: error: ‘AEDesc’ undeclared (first use in this function)
我怎样才能克服这些?以我有限的知识,我安装的 ruby 文件似乎有错误......但可能还有一段路要走。
我的轨道-V:
Rails 3.2.9
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.1]