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 on Rails 5 Basics Creating an App Our First Resource

Ali Iftakhar
Ali Iftakhar
729 Points

Windows ruby bin\rails Error

I keep getting error when I run the command line. Here's the transcript of it (note: I'm using windows)

ruby bin\rails generate scaffold Post title:string ruby: No such file or directory -- bin/rails (LoadError)

I've tried everything I could but can't make it work. Any advice would be much appreciated.

1 Answer

Ari Misha
Ari Misha
19,323 Points

Hiya there! i'm a fellow windows user as well for Rails. On windows, Rails could be slight problematic. But first things first, make sure you've Environment Path variable set. Secondly, In order to access rails, you're gonna have to use "Ruby". But i see thats not working as well. But with Rails 5.0, you dont have to use "bin\rails"(thats for Mac/Linux users), you could use "Rails" instead. So yeah try this:

rails generate scaffold Post title:string 

One more additional thing i'd wanna point out as well , is whenever you're going to run "bundle install" , its going to throw an error as well. So run this command in order to run "bundle install" or install any gems:

ruby bin/bundle install 

or

ruby bin/bundle install [gemName]

I hope it helped. (: