PDA

View Full Version : ROR rake tells me gems are missing but they're not



aliak
06-08-2010, 07:13 PM
Hey guys,

When I run rake db:migrate:reset in my app root folder I get an error telling me to install missing gems using rake gems:install. So I did this, ran rake db again and got the same error. So I installed the gems via cpanel, but rake gives me the same error again! So I installed the gems using gem install --remote <gem_name> and everytime the gem installations work. But I still can't migrate my database because of "Missing Gems".

I'm only using two extra gems and they are listed in my environment.rb file. Any clues as to what's up?

environment.rb===
config.gem "formtastic"
config.gem "authlogic"

atoms
06-18-2010, 12:10 PM
I have no clue as to what is up, but inspired by your question I tried running one of my non RoR ruby scripts from the command line and got:

`gem_original_require': no such file to load -- mysql

I commented out the "require mysql" line in my script and I stopped getting the error message. The script in question has been running super sporadically for a couple of months but I've been too lazy/busy to look into the cause. I'm hoping that this was it - as for why it would work from cron SOMETIMES, that remains a mystery.

UPDATE: commenting out the require only made the script pass a syntax check (which I don't think I'm actually doing correctly either). I was able to do a simple "gem install mysql" on the command line and the script now runs without complaint.

UPDATE 2: ruby -c rubyFile.rb will do a syntax check.