Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Ruby Set up Git and Add Gems

Hello there,

I am doing something wrong here, please someone could help. Thanks

This is my notepad++

group :development, :test do gem 'rspec-rails', '~> 2.0' end

group :test do gem 'capybara', '~> 2.1.0' end

and this is command terminal / virtual box when I try to type bundle

Gemfile syntax error: group: development, test do

6 Answers

Ethan Lowry
PLUS
Ethan Lowry
Courses Plus Student 7,323 Points

I think you have 2 different Gemfiles somewhere and the one causing the error is not the one you're working on - the code in your error message is clearly not the same as the code in the Gemfile you're looking at (look at where the colon is compared to yours).

The file you are working on in that screenshot is 'Gemfile.txt' - that's wrong, the file should simply be called 'Gemfile' with no file extension. Look at all the files in your project's root directory (try the command 'ls -a' to list all files including hidden ones) and see if there is another Gemfile in there somewhere.

Ethan Lowry
PLUS
Ethan Lowry
Courses Plus Student 7,323 Points

What you've posted there looks OK as far as I can tell....are you posting all of that on one line, or like this:

group :development do
  gem 'rspec-rails', '~> 2.0'
end

I'm not sure if it should matter but might be worth trying.

Also ensure that you have colons before all group names but not after "group" - I notice you have typed it slightly different in your error message compared to in your code.

Well it is still does not work Please take a look here: http://tinypic.com/r/30bjml1/8

Thanks. I have this. http://tinypic.com/r/11sdzxk/8

Ethan Lowry
Ethan Lowry
Courses Plus Student 7,323 Points

Cool, so the one you need to make your changes in is the one that's just called Gemfile. If that works for you please remember to mark my answer as the correct one :)

Thank you very much for your help! It is good! :-)

Ethan Lowry
Ethan Lowry
Courses Plus Student 7,323 Points

No problem - in future try and remember to use comments on existing answers, all your comments so far have actually been new answers themselves :)

Yes I will. Thanks

I know where was the problem now. Notepad has a .text save option as a default and when I saved my project it saved as .text file.