2013-11-03 64 views
0

我正在嘗試遵循Ruby教程(Michael Hartl)的書。我在Gemfile中得到這個錯誤:41(一些步驟前,它是在Gemfile中:35):在Ruby/Rails/Aptana中安裝捆綁軟件時出現這種錯誤?

Franciscos-MacBook-Pro:first_app franciscomello$ bundle install --without production 
Undefined local variable or method `rb' for Gemfile 
     from /Users/franciscomello/Desktop/Aptana Studio 3 Workspace/First_app/Gemfile:41 

我試過很多技巧。例如,我有沙箱正確的輸出:

Franciscos-MacBook-Pro:first_app franciscomello$ which ruby irb gem rake 
/usr/bin/ruby 
/usr/bin/irb 
/usr/bin/gem 
/usr/bin/rake 

我已經調試我的Gemfile,它看起來像這樣:

source 'https://rubygems.org' 

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '4.0.0' 

# Use sqlite3 as the database for Active Record 
gem 'sqlite3', '1.3.8' 


# Use SCSS for stylesheets 
gem 'sass-rails', '4.0.0' 

# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '2.1.1' 

# Use CoffeeScript for .js.coffee assets and views 
gem 'coffee-rails', '4.0.1' 

# See https://github.com/sstephenson/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use jquery as the JavaScript library 
gem 'jquery-rails', '3.0.4' 

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 
gem 'turbolinks', '1.1.1' 

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '1.0.2' 

group :doc do 
    # bundle exec rake doc:rails generates the API under doc/api. 
    gem 'sdoc','0.3.20', require: false 
end 

group :production do 
    gem 'pg', '0.15.1' 
    gem 'rails_12factor', '0.0.2' 
end 
#sugestao do Tutorial 
gem rb-readline 
+1

順便提一句......有用的提示...... Gemfile中的錯誤:41告訴你問題出在Gemfile的第41行上......所以你會發現「gem rb-readline」是問題的根源。 – SteveTurczyn

+0

非常感謝Steve! – kikomello

回答

5

應該

gem 'rb-readline' 

不帶引號,它試圖將其解釋爲變量......特別是rb減去readline