0

So I am currently learning Ruby on Rails using Michael Hartl tutorial (really noob at the moment - really new to programming). I have tried to edit the gemfiles in the "hello_app" that I am making - as told to do so by Michael, however when I go back into Terminal to run the bundle install - I get the following rather than it installing:

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$ 

Can someone please let me know what is going on? And how do I fix it? Here's what I have in my Atom Text Editor:

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]

Thank you very much for going through this.Please do explain what os going on so I learn as well as correcting the errors. Obviously you can tell I am really, really new to this game but am eager to learn!

Please advise, Thanks!

1
  • Try this one, Define gem definition without giving versioning gem 'sqlite3' in you Gemfile. or with giving versioning try this one gem 'sqlite3', '1.3.12' Commented May 31, 2017 at 5:15

1 Answer 1

1

There are two typos/errors in the group :development, :test from your Gemfile:

  1. You are missing quotes (or double quotes) in your sqlite3 gem version:

    gem 'sqlite3' , 1.3.12
                   ^      ^ 
    
  2. There is a missing and trailing comma , in gem 'byebug'

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

So group :development, :test should look like this:

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
Sign up to request clarification or add additional context in comments.

2 Comments

It worked after using your edits and a bundle update. Thanks!
@abdulmuhaimen Great! Please don't forget to accept the answer (by clicking the green tick). Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.