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


Deploying Treebook to Heroku

When I try to deploy my Treebook to Heroku, and use the 'heroku run rake db:migrate' I get the following error: Running rake db:migrate attached to terminal... up, run.6085 /usr/bin/env: ruby.exe: No such file or directory

As shown in the video, I am however stuck on the first "error displayed" on my application site.

" Application Error

An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details. "

What am I doing wrong :?

3 Answers

Alan Johnson
Alan Johnson
7,625 Points

It looks like you may need to update the first line of bin/rake to be #!/usr/bin/env ruby. You may want to go ahead and update the first line in bin/bundle and bin/rails as well to make sure you don't run into similar problems on other scripts on heroku as well.

Could I get something a bit more descriptive and newbie friendly O:)?

Alan Johnson
Alan Johnson
7,625 Points

Sure thing - sorry about that.

You'll want to fire the project up in your editor and look for a file in the bin folder called rake. The first line of that file should look like this:

#!/usr/bin/env ruby.exe

You want to change that first line to be:

#!/usr/bin/env ruby

Then you'll commit it to your repo and push it up to heroku just like in the videos. You want to repeat this with the files called rails and bundle in the bin folder.