Gemfile Analysis Error

I am working on a training rails project on

http://railsapps.imtqy.com/installrubyonrails-mac.html

I am in the "Rails Application Examples" section, but when I run

bundle install --without production 

I get this error:

  [!] There was an error parsing `Gemfile`: no .<digit> floating literal anymore; put 0 before dot - ruby '2.3.0' ^ /Users/eric.park/workspace/learn-rails/Gemfile:2: syntax error, unexpected tFLOAT, expecting '(' ruby '2.3.0' ^. Bundler cannot continue. # from /Users/eric.park/workspace/learn-rails/Gemfile:2 # ------------------------------------------- # source 'https://rubygems.org' > ruby '2.3.0' # gem 'rails', '4.2.5' # ------------------------------------------- 

I am new to rails, so if anyone can explain what this error means at all, and how can I address it if it reappears, which would be really helpful.

+8
ruby-on-rails
source share
2 answers

This is a quotation problem.

Try manually entering the sentence again using a single or double quote.

ruby '2.3.0' or ruby "2.3.0"

This should fix it.

+8
source share

I found that if you copy and paste the code into the Gemfile, which, as you say, created using textedit, also carries unconfirmed syntax and formatting, so my solution was to open a completely empty document or write it directly in VIM, etc., and enter from scratch - do not copy or paste the code, otherwise you run the risk of copying inadvertent formatting and embedded syntax that you may not be able to see.

+2
source share

All Articles