0

I have been working through the Ruby on Rails 3 Tutorial, and recently switched from RVM to rbenv, per a recommendation from a Rubyist friend of mine.

Unfortunately, now when I create a new project and then attempt to $ bundle install I get this error:

/Users/alexanderdiner/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/dsl.rb:7:in `instance_eval': /Users/alexanderdiner/rails_projects/sample_app/Gemfile:1: syntax error, unexpected tIDENTIFIER, expecting $end
gem 'sqlite...3.2.3'ygems.org' 
...                               ^ (SyntaxError)

I have been readin through some rbenv docs and such, but still struggling to find the issue here. For reference, the gemfile is as follows:

source 'http://rubygems.org'
gem 'rails', '3.2.3'
gem 'sqlite3'
gem 'gravatar_image_tag', '0.1.0'
gem 'will_paginate', '3.0.pre2'
group :development do
  gem 'rspec-rails', '2.0.1' 
  gem 'annotate-models', '1.0.4' 
  gem 'faker', '0.3.1'
end
group :test do
 gem 'rspec', '2.0.1'
 gem 'webrat', '0.7.1'
 gem 'spork', '0.8.4'
 gem 'factory_girl_rails', '1.0'
end
Alexander
  • 49
  • 1
  • 1
  • 7

2 Answers2

1

Change:

group :development do
  gem 'rspec-rails', '2.0.1' gem 'annotate-models', '1.0.4' gem 'faker', '0.3.1'
end

to

group :development do
  gem 'rspec-rails', '2.0.1' 
  gem 'annotate-models', '1.0.4'
  gem 'faker', '0.3.1'
end

It should be enough.

lucapette
  • 20,564
  • 6
  • 65
  • 59
  • I made this change and am still receiving the same error as before. – Alexander Apr 16 '12 at 16:32
  • What's the output of `ruby -c Gemfile`? Here is `Syntax OK`, just tried. So there should be something else. – lucapette Apr 16 '12 at 21:31
  • The output is: `Gemfile:1: syntax error, unexpected tIDENTIFIER, expecting $end gem 'sqlite...3.2.3'ygems.org' ... ^` – Alexander Apr 17 '12 at 01:34
  • @Alexander: Please update your `Gemfile` again. It looks like it has a serious syntax error. If you have already posted it here, please considering posting it on http://gist.github.com. – Ryan Bigg Apr 17 '12 at 14:50
0

You might have an unprintable character in your Gemfile. Rename it, then create a new one using the contents you posted in your question.

Kelvin
  • 20,119
  • 3
  • 60
  • 68