2017-05-30 45 views
0

所以我目前正在使用Michael Hartl教程学习Ruby on Rails(目前确实是noob--对编程来说真的很新颖)。我试图编辑我正在制作的“hello_app”中的gemfiles - 正如迈克尔告诉我这样做的,但是当我返回终端运行捆绑安装时 - 我得到以下内容而不是安装:Ruby on Rails软件包安装不工作

Abduls-MacBook-Pro:hello_app Monahim$ bundle install 

[!] There was an error parsing `Gemfile`: unexpected fraction part after numeric literal - gem 'sqlite3' , 1.3.12 
       ^
/Users/Monahim/railsmhartl/hello_app/Gemfile:40: syntax error, unexpected tIDENTIFIER, expecting keyword_end 
gem 'byebug', '9.0.0' platform: :mri, end 
          ^
/Users/Monahim/railsmhartl/hello_app/Gemfile:55: syntax error, unexpected end-of-input, expecting keyword_end. Bundler cannot continue. 

# from /Users/Monahim/railsmhartl/hello_app/Gemfile:38 
# ------------------------------------------- 
# group :development, :test do 
> gem 'sqlite3' , 1.3.12 
# # Call 'byebug' anywhere in the code to stop execution and get a debugger console 
# ------------------------------------------- 
Abduls-MacBook-Pro:hello_app Monahim$ 

有人能让我知道发生了什么吗?我该如何解决它?下面是我在我的Atom文本编辑器:

source 'http://rubygems.org' 

git_source(:github) do |repo_name| 
    repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") 
    "ht//githublinkhere /#{repo_name}.git" 
end 

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '~> 5.0.1' 
# Use sqlite3 as the database for Active Record 

# Use Puma as the app server 
gem 'puma', '~> 3.4.0' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0.6' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 3.0.0' 
# See /githubrailsreadmelinkhere for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use CoffeeScript for .coffee assets and views 
gem 'coffee-rails', '~> 4.2.1' 
gem 'jquery-rails', '4.1.1' 
# Turbolinks makes navigating your web application faster. Read more:   /githubturbolinkhere 
gem 'turbolinks', '~> 5.0.1' 
# Build JSON APIs with ease. Read more: linktojbuilder 
gem 'jbuilder', '~> 2.4.1' 
# Use Redis adapter to run Action Cable in production 
# gem 'redis', '~> 3.0' 
# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# Use Capistrano for deployment 
# gem 'capistrano-rails', group: :development 

group :development, :test do 
    gem 'sqlite3' , 1.3.12 
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console 
    gem 'byebug', '9.0.0' platform: :mri, 
end 
# Adds support for Capybara system testing and selenium driver 

group :development do 
    # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 
    gem 'web-console', '>= 3.1.1' 
    gem 'listen', '>= 3.0.5', '< 3.0.8' 
    # Spring speeds up development by keeping your application running in the background. Read more: /github.com/railsspringlinkhere 
    gem 'spring' , '1.7.2.' 
    gem 'spring-watcher-listen', '~> 2.0.0' 
end 

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 

非常感谢您的经历this.Please做解释什么操作系统回事,所以我学习以及纠正错误。显然你可以告诉我这个游戏真的很新,但是很想学习!

请注意, 谢谢!

+0

试试这一个,定义宝石定义没有给你'Gemfile'版本'宝石“sqlite3''。或给予版本试试这个'宝石“的sqlite3”,“1.3.12'' –

回答

1

有两个错别字/在group :development, :test错误,从您的Gemfile

  1. 你缺少你sqlite3宝石版引号(或双引号):

    gem 'sqlite3' , 1.3.12 
          ^ ^
    
  2. 有一个缺失和尾随逗号, in gem 'byebug'

    gem 'byebug', '9.0.0' platform: :mri, 
            ^   ^
    

所以group :development, :test应该是这样的:

group :development, :test do 
    gem 'sqlite3', '1.3.12' 
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console 
    gem 'byebug', '9.0.0', platform: :mri 
end 
+0

它使用您的编辑和包更新后的工作。谢谢! –

+0

@abdulmuhaimen太好了!请不要忘记接受答案(点击绿色勾号)。祝你好运! – Gerry