Ruby on Rails捆绑安装不起作用

时间:2017-05-30 23:09:34

标签: ruby-on-rails ruby sqlite rubygems

所以我目前正在使用Michael Hartl教程学习Ruby on Rails(目前真的是noob - 对于编程来说真的很新)。我试图在" hello_app"中编辑gemfiles。我正在制作 - 正如迈克尔所说,但当我回到终端运行捆绑安装时 - 我得到以下内容而不是安装:

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]

非常感谢你仔细阅读。请解释一下os的内容,以便我学习并纠正错误。显然你可以告诉我这个游戏真的很新,但我很想学!

请指教, 谢谢!

1 个答案:

答案 0 :(得分:1)

group :development, :test的{​​{1}}中有两个拼写错误/错误:

  1. Gemfile宝石版中缺少引号(或双引号):

    sqlite3
  2. gem 'sqlite3' , 1.3.12 ^ ^

    中有一个缺失和尾随的逗号,
    gem 'byebug'
  3. 所以gem 'byebug', '9.0.0' platform: :mri, ^ ^ 应如下所示:

    group :development, :test