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
nick theodorou
1,784 Pointsgenerate rails application error
i type "rails new treebook", but it gets stuck on "install bundle" same problem as http://stackoverflow.com/questions/17652983/cannot-create-application-with-rails
tried to change permissions as suggested, but didn't work. I'm using window 7
3 Answers
Ralph Robot
217 PointsWhat version of Rubygems are you using? There's a known bug in 2.0.3 that will cause that error. You can check your Rubygems version like this:
gem -v
Upgrade Rubgems like this:
gem install rubygems-update
update_rubygems
gem update --system
nick theodorou
1,784 Pointsit says i'm running 2.1.10
i tried the above commands and got: ERROR: While executing gem ...(Errno::EACCES) Permission denied - C:/RailsInstaller/Ruby1.9.3/bin/update_rubygems.bat
any ideas?
Ralph Robot
217 PointsThe error itself is saying that you don't have write permissions to that directory. One common cause of that problem is not using a Ruby version manager such as RVM or rbenv.
On OS X and Linux, thoughtbot prefers rbenv.
It looks like you're using RailsIntaller on Windows, which I'm not as familiar with. From what I can tell, it does not set up RVM for you, and also looks like it's about a year behind in keeping up with the stable Ruby version. It installs Ruby 1.9.3 whereas the current release is Ruby 2.0.0, patch-level 353. Ruby 2.1.0 is in prerelease. The ongoing improvements to the language are another reason to use RVM to stay up to date with the latest features, bug fixes, and security patches.
So, I'd say option number one for you is to install RVM on your Windows machine. I don't know a lot about this approach.
The one downside to this approach is that you'll likely be deploying to a Unix environment on a hosting platform such as Amazon EC2 or Heroku. The more you have development/production parity, meaning your development environment matches production, the fewer differences you'll see, or surprises you'll have, when it comes time to deploy new code. You may also spend time fixing Windows-specific issues in development that you don't need to fix for your production environment.
So, you could buy an Apple laptop (expensive) or install Ubuntu on your machine (free, fun for some people but time-consuming and frustrating for others).
If your goal is just to get up and running with Rails so you can start creating software, however, there's a middle-ground approach that I really like: try Nitrous I/O. It creates a hosted Rails development environment on EC2 and handles all these Rails, Ruby, RVM, etc. issues for you. Their tag line of getting a Rails environment set up in 60 seconds is not just marketing. I've tried it and it's true.
So, that's a long-winded way of saying I suggest giving Nitrous I/O a try first. I think you'll find it has the least set up headaches and also will give you nice development/production parity.
nick theodorou
1,784 PointsNitrous.io looks awesome so I'll give that a try first, thanks for the help.