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 Building Web Apps with Sinatra Adding New Data Saving Text Files

Kyle Shamblin
Kyle Shamblin
9,945 Points

test.rb file wont load.

For some reason my test.rb file wont load. (I'm using the online workspace.) I typed: "ruby test.rb" and got the error message: "ruby: No such file or directory -- test.rb (LoadError)" I saved the test.rb file so I have no idea whats going on. Any help would be appreciated!

1 Answer

Michael Hall
PLUS
Michael Hall
Courses Plus Student 30,909 Points

It sounds like your not on the same level as your test.rb file. So if test.rb is in the root of your directory and from the console you are on the root directory then you can call ruby test.rb and it will work. However, if your test.rb is in the public directory, for instance, you would need to run ruby public/test.rb Or you could cd into it by running the command: cd public then running ruby test.rb

to see if it your file is on your level, run the command ls it will show you a list of files in your current location.

to move up a level in your directory run cd ..