If your Ruby on Rails unit tests complain about not being able to find a table after you’ve added a new model, it just means you forgot to prepare the test database with the latest data. The error looks like this:
ActiveRecord::StatementInvalid: Could not find table ‘yourtablenamehere’
To fix, just run:
and then re-run your test.
Let’s say you’ve deleted some files that are being tracked in git, and you want to remove them entirely from git. Find the solution here.
I’ve never had this issue before, but I recently started using rvm and for whatever reason got the following error when trying to do rake db:migrate
uninitialized constant Rake::DSL
After googling around and trying a bunch of convoluted solutions (many which addressed a broken 0.9.0 build of rake), I found that adding the following line to my Rakefile fixed everything:
If you’re mucking about with your .vimrc file and want to test your latest changes, simply use (while editing the .vimrc file itself):
Sometimes you’ll be handed a file from a Windows user and it will contain a bunch of “^M” characters at the end of every line. Removing them is easy, just run the command:
To get the “^M” properly, don’t type “^” and “M”. Instead, type “ctrl + v”, then “ctrl + m”.