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

Following along with rails app, broken it, need help trying to revert to previous project files.

Hi,

I've just started the section 'Creating an Authentication System' and broke the site while trying to install Devise.

I figured, hey no problem, I'll just revert to a previous git commit and start this section again. I couldn't figure out how to so this. None of the git commands the tutorials had shown would enable me, Or I just used them incorrectly.

So, I thought I'd start again with the previous sections source files. I deleted the local 'treebook' directory, downloaded the previous sections source files, unpacked them, renamed it to 'treebook', then started my server once more using the 'rails server' command.

What could possibly go wrong?

Well, seems the server starts, then stops and I get a bunch of errors that make no sense to me...

/usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rubygems-bundler-1.1.0/lib/rubygems-bundler/noexec.rb:31:in pwd': No such file or directory - getcwd (Errno::ENOENT) from /usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rubygems-bundler-1.1.0/lib/rubygems-bundler/noexec.rb:31:in<module:Noexec>' from /usr/local/rvm/gems/ruby-1.9.3-p392@global/gems/rubygems-bundler-1.1.0/lib/rubygems-bundler/noexec.rb:30:in <top (required)>' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:inrequire' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in rescue in require' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:inrequire' from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:9:in `<main>'

I'd love to get back to a working instance. Ideally via git because I really need to understand how to do it the right way, but getting the downloaded project files working would be a great help too.

Thanks.

1 Answer

Marcus Tisäter
Marcus Tisäter
4,886 Points

If you go to GitHubs webpage and go to you're repositories you should see all of the commits which have been done. It's possible to receive all of the old files there. About the error message: Make sure you are located at the same directory as the files is located at and update you're bundler and check if all of you're gems are also installed then it should be ok

Being a complete novice to ruby, rails, command line etc, it took a while to figure out how to do the steps you proposed. They did work, so thank you Marcus.

For any other complete beginners this is what I did...

gem install rake # create a new gemset

bundle install #reinstalled bundler

rake db:migrate # migrate databases to match new project.
Marcus Tisäter
Marcus Tisäter
4,886 Points

Glad I could help! Cute dogs you got there btw :)