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 trialJeffrey Cheong
5,653 PointsI am getting errors when trying to install a 'rails new testapp' & the 'bundle rails exec server' error installing json
error installing JSON 1.8.3 for rails new testapp however it still makes a new folder and "could not find gem ;sass-rails (->5.0) x86-mingw32 in any of the gem sources listed in your... THanks!
Jeffrey Cheong
5,653 PointsIm new to rails and really don't know anything about it so im not to sure what the gemfile is, testapp? I am pretty much just following the steps from the 'installing rails on windows' video. I am thinking it may be because there are different versions I am downloading but I retried all the steps with the versions used in the video (other than Git) and it still wasn't working.
2 Answers
Jeffrey Cheong
5,653 PointsHey guys, I turns out I had to make a small change in the GemFile, I changed the source from 'https://rubygems.org' to 'http://rubygems.org' in the first testapp which allowed all the gems to be downloaded and all other new rails apps works perfect now. Thanks for all the help and advice!
Seth Reece
32,867 PointsHi Jeffrey,
Your gemfile is located in the root of your rails app. It's named Gemfile. Often times when I get "could not find gem" it usually means I need to install it. e.g. In your console gem install sass-rails
You can check what gems you have installed by using either gem list
or search with gem search ^searchterm
You can also get a nice pretty GUI with links to docs and gem sources by running gem server
and visiting localhost:8808 in your browser. You can also make sure you have the current version of a gem at RubyGems.org. To use a different version in you app, find the gem in your Gemfile and you will want a syntax of gem "some_gem", "~> 1.1.1"
Jim Joyce
4,702 PointsThis is more than likely the correct answer for your issue. Just want to add on to this that rails uses the 'bundler' gem to manage dependencies. I haven't watched any rails videos on here, but it looks like they had you install it already and you'll soon become very familiar with it when inside the rails world.
You can install individual gems running that gem install gem_name
, but bundler should be able to take care of that for you. Every time you create a new rails project you should run bundle
or bundle install
to install whatever you're using on your project. All gems located in the Gemfile will be installed and you should then be able to get the server up and running.
You can also start your server up by just running rails s
or rails server
without having to prepend bundle exec. The only difference is bundle exec
will run the server in the context of the current directory's bundle (gemfile). Useful if you have specific versions of gems you need to use, but the other two options are perfectly fine and will work all the same.
Jim Joyce
4,702 PointsJim Joyce
4,702 PointsIf you could post the Gemfile it would help a lot. Also are you bundle installing everything in there right away or just trying to run the server right away? Could also try just running rails s if you don't care about versioning.