undefined method `database_authenticatable' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x9dee690> - ruby-on-rails-3

I am using Active Admin gem for my small application based on Quiz. But when I execute rake db:migrate it gives me error. Following is the trace of the command :
$ rake db:migrate RAILS_ENV=production --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
== DeviseCreateAdminUsers: migrating =========================================
-- create_table(:admin_users)
rake aborted!
An error has occurred, all later migrations canceled:
undefined method `database_authenticatable' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x9dee690>
/home/users/Documents/Quiz/db/migrate/20120509055635_devise_create_admin_users.rb:4:in `block in change'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:160:in `create_table'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/connection_adapters /abstract_mysql_adapter.rb:432:in `create_table'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:466:in `block in method_missing'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:438:in `block in say_with_time'
/home/users/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/benchmark.rb:295:in `measure'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:438:in `say_with_time'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:458:in `method_missing'
/home/users/Documents/Quiz/db/migrate/20120509055635_devise_create_admin_users.rb:3:in `change'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:407:in `block (2 levels) in migrate'
/home/users/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/benchmark.rb:295:in `measure'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:407:in `block in migrate'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:119:in `with_connection'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:389:in `migrate'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:528:in `migrate'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:720:in `block (2 levels) in migrate'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:777:in `call'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:777:in `ddl_transaction'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:719:in `block in migrate'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:700:in `each'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:700:in `migrate'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:570:in `up'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/migration.rb:551:in `migrate'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.2.3/lib/active_record/railties/databases.rake:153:in `block (2 levels) in <top (required)>'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/users/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/users/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/users/.rvm/gems/ruby-1.9.2-p318/bin/rake:19:in `load'
/home/users/.rvm/gems/ruby-1.9.2-p318/bin/rake:19:in `<main>'
Tasks: TOP => db:migrate
Follwoing is my GemFile :
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'devise'
gem 'activeadmin', :git => 'https://github.com/gregbell/active_admin.git'
gem 'therubyracer'
gem 'formtastic'
gem 'haml'
gem 'paperclip'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
Content of 20120509055635_devise_create_admin_users.rb is
class DeviseCreateAdminUsers < ActiveRecord::Migration
def change
create_table(:admin_users) do |t|
t.database_authenticatable :null => false
t.recoverable
t.rememberable
t.trackable
# t.encryptable
# t.confirmable
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
# t.token_authenticatable
t.timestamps
end
# Create a default user
AdminUser.create!(:email => 'admin#example.com', :password => 'password', :password_confirmation => 'password')
add_index :admin_users, :email, :unique => true
add_index :admin_users, :reset_password_token, :unique => true
# add_index :admin_users, :confirmation_token, :unique => true
# add_index :admin_users, :unlock_token, :unique => true
# add_index :admin_users, :authentication_token, :unique => true
end
end
I searched for the above issue and got this , but this doesn't helped me out. Everywhere I found this solution only.
Does any one came across this issue before, if yes what you did to tackle it? Any help on this will be appreciated. Thanks

I also ran into this issue on my existing app as I tried to deploy to a new staging server.
Ended up being that the Devise gem had been updated to 2.1 and I hadn't fixed the migration to work correctly with the new version.
Be sure to read through their migration to 2.1 doc on their wiki -- https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.1
Also, be sure to read through the doc for how to correctly adjust existing migrations -- https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0-migration-schema-style

I've run into this twice and there is a really easy solution - instead of db migrations, run this:
heroku run rake db:create
# optionally with --app your_apps_name if you have multiple apps.
then:
rake db:schema:load

I just had what I think is the same issue, I updated my gem, and dropped my db, later I got a very similar message, then I created a new rails app just to compare and it turns out the migration file has been changed, now it includes the columns instead of calling methods.
I hope it helps.
Cheers!

I think the problem might be as result of changes in Devise 2.0 migration schema style. Check out new schema format on the link below. Update migration accordingly and try again. This worked for me especially with #heroku
https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0-migration-schema-style

New to this site as you can see from my rep. John Kamuchau is correct, you need to change the xxxx_devise_create_users.rb migration according to your version.
For example I just updated a rails 3.2 to 4.2 updating devise accordingly and I had to change out the deprecated -
t.database_authenticatable :null => false
for -
## Database authenticatable
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""
Old question but hope this helps if someone comes looking.

Related

Rails application failed to start properly - not sure why

I have a personal rails app running on DreamHost.com. It's been running fine, but I haven't been on it in a couple of weeks. Now, when I go to the site, I get the message, "Rails application failed to start properly". I ssh'd to my account and tried running a command from the terminal. I tried to enter the console in production mode and I tried running 'rake routes'. For both, I get the following output. I'm thinking it is a routes problem but I'm really not sure. I was hoping someone more into rails than I am might be able to tell if the problem is being reported to me and what it is.
Thanks for any assistance.
Here is what I'm running:
[coneflower]$ ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
[coneflower]$ gem -v
1.8.25
[coneflower]$ rails -v
Rails 3.2.2
Error output:
[coneflower]$ rake routes
rake aborted!
missing :action
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:183:in `default_controller_and_action'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:76:in `normalize_options!'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:59:in `initialize'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1302:in `new'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1302:in `add_route'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1282:in `decomposed_match'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `block in match'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `each'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `match'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:258:in `root'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1315:in `root'
/home/johndcow/rails/drywall/releases/20130306000519/config/routes.rb:2:in `block in <top (required)>'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:276:in `instance_exec'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:276:in `eval_block'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:254:in `draw'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `block in load'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties- 3.2.2/lib/rails/application/routes_reloader.rb:40:in `each'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:16:in `reload!'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:26:in `block in updater'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/file_update_checker.rb:78:in `call'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.2/lib/active_support/file_update_checker.rb:78:in `execute'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:27:in `updater'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `instance_exec'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `run'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `each'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `run_initializers'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application.rb:136:in `initialize!'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/johndcow/rails/drywall/releases/20130306000519/config/environment.rb:5:in `<top (required)>'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application.rb:103:in `require'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application.rb:103:in `require_environment!'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.2/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/home/johndcow/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => routes => environment
(See full trace by running task with --trace)
[coneflower]$
Routes File:
Drywall::Application.routes.draw do
resources :access, :only => :index
resources :users, :only => [:index, :new]
resources :payments
resources :materials
resources :hours
resources :jobs
resources :customer
resources :reports, :only => :index do
collection do
get :statement
end
end
# I removed the commented out examples here
#
# The priority is based upon order of creation:
# first created -> highest priority.
# See how all your routes lay out with "rake routes"
# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
match ':controller(/:action(/:id))(.:format)'
end
That resources :access may be causing issues. It's known to break pluralization in rake in prod. mode. See http://bparanj.blogspot.no/2011/07/reserved-words-in-rails.html

Spork and Guard EADDRINUSE

I'm building a rails app and using Spork/Guard/Rspec for testing.
I'm on a mac (10.6.8) -- here are the gems I'm using:
gem "rspec-rails", "~> 2.12.1"
gem "guard-rspec", "~> 2.3.3"
gem "guard-spork", "~> 1.4.1"
gem "spork", "~> 0.9.2"
gem 'rb-fsevent', '~> 0.9.1', :require => false
gem "growl", "~> 1.0.3"
gem 'capybara', '1.1.2'
When I edit my routes file it should restart the spork server here's the line in my Guardfile:
guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' }, :foreman => true do
watch('config/routes.rb')
end
But recently I just started getting the following error when I add a new route:
Loading Spork.prefork block...
Rack::File headers parameter replaces cache_control after Rack 1.5.
Address already in use - bind(2) (Errno::EADDRINUSE)
/Users/cyrus/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:861:in `initialize'
/Users/cyrus/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:861:in `open'
/Users/cyrus/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:861:in `open_server'
/Users/cyrus/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:759:in `block in open_server'
/Users/cyrus/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:757:in `each'
/Users/cyrus/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:757:in `open_server'
/Users/cyrus/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:1342:in `initialize'
/Users/cyrus/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:1624:in `new'
/Users/cyrus/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:1624:in `start_service'
/Users/cyrus/.rvm/gems/ruby-1.9.3-p125#h/gems/spork-0.9.2/lib/spork/server.rb:29:in `listen'
/Users/cyrus/.rvm/gems/ruby-1.9.3-p125#h/gems/spork-0.9.2/lib/spork/server.rb:20:in `run'
/Users/cyrus/.rvm/gems/ruby-1.9.3-p125#h/gems/spork-0.9.2/lib/spork/runner.rb:75:in `run'
/Users/cyrus/.rvm/gems/ruby-1.9.3-p125#h/gems/spork-0.9.2/lib/spork/runner.rb:10:in `run'
/Users/cyrus/.rvm/gems/ruby-1.9.3-p125#h/gems/spork-0.9.2/bin/spork:10:in `<top (required)>'
/Users/cyrus/.rvm/gems/ruby-1.9.3-p125#h/bin/spork:23:in `load'
/Users/cyrus/.rvm/gems/ruby-1.9.3-p125#h/bin/spork:23:in `<main>'
Usually when spork boots up I get the following:
Loading Spork.prefork block...
Rack::File headers parameter replaces cache_control after Rack 1.5.
Spork is ready and listening on 8989!
How do I avoid this error?
I came here suffering the same problem as the OP.
After going down the rabbit hole of the 'error is a bug' post, and examining the line of code where the failure occurred, I rebooted out of frustration. I realized after doing this that the lock on the port likely came from the fact that I had logged out of the previous desktop session, and that the Spork DRb server hangs RubyMine on closing, so maybe that is what leaves the port open.
Sure enough, I could now start the Spork server.
I add this so other people facing this problem can consider if it matches their situation.
By removing the :foreman => true in the Guardfile I was able to get rid of this problem. Right now I'm not making meaningful use of the values in my .env file in my tests so that should be fine, but I'm submitting an issue on Github.
Looks like this error is a bug: https://github.com/rails/rails/pull/8812

DeviseCreateUsers: migrating create_table(:users) rake aborted

I encountered the following error while running rake db:migrate --trace. my rails version - rails 3.2.0. And i am trying to run the project https://github.com/ninetwentyfour/Hospitium. I am newbie to ruby to ruby on rails
errors:
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Invoke disable_rails_admin_initializer (first_time)
** Execute disable_rails_admin_initializer
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
== **DeviseCreateUsers: migrating** ==============================================
-- **create_table(:users)**
**rake aborted!
An error has occurred, all later migrations canceled:
undefined method `database_authenticatable'** for #<ActiveRecord::ConnectionAdapte
rs::TableDefinition:0x5d49098>
E:/ruby projects/Hospitium Animal Hospital/db/migrate/20110904205556_devise_crea
te_users.rb:4:in `block in up'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/connect
ion_adapters/abstract/schema_statements.rb:160:in `create_table'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/connect
ion_adapters/abstract_mysql_adapter.rb:422:in `create_table'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:450:in `block in method_missing'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:424:in `block in say_with_time'
C:/Ruby193/lib/ruby/1.9.1/benchmark.rb:280:in `measure'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:424:in `say_with_time'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:444:in `method_missing'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:334:in `method_missing'
E:/ruby projects/Hospitium Animal Hospital/db/migrate/20110904205556_devise_crea
te_users.rb:3:in `up'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:358:in `up'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:396:in `block (2 levels) in migrate'
C:/Ruby193/lib/ruby/1.9.1/benchmark.rb:280:in `measure'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:396:in `block in migrate'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/connect
ion_adapters/abstract/connection_pool.rb:118:in `with_connection'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:377:in `migrate'
C:in `migrate'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:704:in `block (2 levels) in migrate'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:761:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:761:in `ddl_transaction'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:703:in `block in migrate'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:684:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:684:in `migrate'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:554:in `up'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/migrati
on.rb:535:in `migrate'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.0/lib/active_record/railtie
s/databases.rake:153:in `block (2 levels) in <top (required)>'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:205:in `call'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `execute'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_lev
el'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handlin
g'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:88:in `top_level'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:66:in `block in run'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handlin
g'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:63:in `run'
C:/Ruby193/bin/rake:32:in `<main>'
Tasks: TOP => db:migrate
My GEM file
source 'http://rubygems.org'
gem 'rails', '3.2.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem "eventmachine", "1.0.0.beta.4.1"
gem 'mysql2'
gem 'devise' # Devise must be required before RailsAdmin
gem 'rails_admin'
gem 'nokogiri'
gem 'mechanize'
gem 'uuidtools'
gem 'cancan'
gem 'paperclip'
gem 'aws-sdk', '~> 1.3.4'
gem 'will_paginate'
gem 'paper_trail'
gem 'oauth'
#gem 'twitter'
gem 'rest-client'
gem 'json'
#gem 'libxml-xmlrpc'
gem 'bitly'
gem 'site_meta'
gem 'meta_search'
gem 'airbrake'
gem 'spork', '~> 1.0rc'
gem 'client_side_validations'
gem 'jqplot-rails'
gem 'asset_sync'
gem 'gravatar_image_tag'
gem 'best_in_place'
gem 'juggernaut'
gem 'jquery-rails'
#gem 'less-rails-bootstrap'
gem "spreadsheet", "0.6.5.8"
gem 'to_xls'
gem 'sanitize'
gem 'redcarpet'
gem 'rqrcode-rails3'
gem 'octokit'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
gem 'closure-compiler'
end
group :development do
gem 'metrical'
end
group :production do
gem 'home_run', :require=>'date'
#gem 'slim_scrooge', :git => "git://github.com/sdsykes/slim_scrooge.git"
gem 'dalli'
gem 'thin'
gem 'pg'
gem 'newrelic_rpm'
gem 'heroku'
end
gem "rspec-rails", :group => [:test, :development]
group :test do
gem "factory_girl_rails"
gem "capybara"
#gem 'capybara-webkit'
gem 'shoulda-matchers'
gem 'cucumber-rails', :require => false
gem 'database_cleaner'
gem 'launchy'
gem 'email_spec'
end
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
----------------------------------------------------------------------------------------
as per Said Kaldybaev solution , i tried
E:\ruby projects\Hospitium Animal Hospital>rails g devise:install
conflict config/initializers/devise.rb
Overwrite E:/ruby projects/Hospitium Animal Hospital/config/initializers/devise.
rb? (enter "h" for help) [Ynaqdh] h
Y - yes, overwrite
n - no, do not overwrite
a - all, overwrite this and all others
q - quit, abort
d - diff, show the differences between the old and the new
h - help, show this help
Overwrite E:/ruby projects/Hospitium Animal Hospital/config/initializers/devise.
rb? (enter "h" for help) [Ynaqdh] a
force config/initializers/devise.rb
identical config/locales/devise.en.yml
===============================================================================
Some setup you must do manually if you haven't yet:
1. Ensure you have defined default url options in your environments files. Her
e
is an example of default_url_options appropriate for a development environm
ent
in config/environments/development.rb:
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
In production, :host should be set to the actual host of your application.
2. Ensure you have defined root_url to *something* in your config/routes.rb.
For example:
root :to => "home#index"
3. Ensure you have flash messages in app/views/layouts/application.html.erb.
For example:
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
If you are deploying Rails 3.1 on Heroku, you may want to set:
config.assets.initialize_on_precompile = false
On config/application.rb forcing your application to not access the DB
or load models when precompiling your assets.
===============================================================================
E:\ruby projects\Hospitium Animal Hospital>rails g devise user
invoke active_record
Another migration is already named add_devise_to_users: E:/ruby projects/Hospiti
um Animal Hospital/db/migrate/20120518093709_add_devise_to_users.rb
E:\ruby projects\Hospitium Animal Hospital>rake db:migrate
== DeviseCreateUsers: migrating ==============================================
-- create_table(:users)
rake aborted!
An error has occurred, all later migrations canceled:
undefined method `database_authenticatable' for #
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
It seems to problem with that repo at that time, https://github.com/ninetwentyfour/Hospitium,
now its working fine.

Error precompiling assets in rails 3. Getting `rake aborted! Unexpected token: keyword (return)`

I'm trying to precompile assets:
Gemfile:
source 'https://rubygems.org'
gem 'rails', '~> 3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
gem 'less'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle the extra gems:
gem 'haml'
gem 'devise'
gem 'hpricot'
gem 'ruby_parser'
gem 'haml-rails'
gem 'simple_form'
gem 'paperclip', "~> 2.0"
gem 'mini_magick'
gem "geocoder", :require => "geocoder"
gem 'kaminari'
gem 'aws-s3'
gem 'cancan'
gem "friendly_id", "~> 4.0.1"
gem 'thin'
gem "twitter-bootstrap-rails"
group :development do
gem 'sqlite3'
gem 'pry'
gem 'rails-pry'
end
group :production do
# gem 'mysql2'
# gem 'ruby-mysql', '~> 2.9.3'
gem 'exception_notification', :require => 'exception_notifier'
gem 'pg', '~> 0.11'
end
group :test do
# gem 'rspec'
# gem 'rspec-rails'
# gem 'cucumber'
# gem 'cucumber-rails'
# gem 'capybara'
# gem 'database_cleaner'
# gem 'webrat'
# gem 'pickle'
# gem 'jasmine'
# gem 'factory_girl'
# gem 'builder', '~> 2.1.2'
# gem 'launchy'
# gem "mocha"
end
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
Stack trace:
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
/Users/victorstan/Sites/pop_bottles ∴ RAILS_ENV=production bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/victorstan/.rvm/rubies/ruby-1.9.3-p125/bin/ruby /Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
Unexpected token: keyword (return)
(in /Users/victorstan/Sites/pop_bottles/app/assets/javascripts/application.js)
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/execjs-1.3.0/lib/execjs/ruby_racer_runtime.rb:32:in `rescue in block in eval'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/execjs-1.3.0/lib/execjs/ruby_racer_runtime.rb:26:in `block in eval'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/execjs-1.3.0/lib/execjs/ruby_racer_runtime.rb:78:in `block in lock'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/therubyracer-0.10.1/lib/v8/c/locker.rb:13:in `Locker'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/execjs-1.3.0/lib/execjs/ruby_racer_runtime.rb:76:in `lock'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/execjs-1.3.0/lib/execjs/ruby_racer_runtime.rb:25:in `eval'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/execjs-1.3.0/lib/execjs/ruby_racer_runtime.rb:17:in `exec'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/uglifier-1.2.4/lib/uglifier.rb:101:in `compile'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/actionpack-3.2.3/lib/sprockets/compressors.rb:74:in `compress'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/processing.rb:265:in `block in js_compressor='
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/processor.rb:29:in `call'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/processor.rb:29:in `evaluate'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/context.rb:177:in `block in evaluate'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/context.rb:174:in `each'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/context.rb:174:in `evaluate'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/bundled_asset.rb:26:in `initialize'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/base.rb:244:in `new'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/base.rb:244:in `build_asset'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/index.rb:89:in `block in build_asset'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/caching.rb:19:in `cache_asset'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/index.rb:88:in `build_asset'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/base.rb:163:in `find_asset'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/index.rb:56:in `find_asset'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/actionpack-3.2.3/lib/sprockets/static_compiler.rb:20:in `block in compile'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/base.rb:212:in `block in each_logical_path'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/base.rb:200:in `block (2 levels) in each_file'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/base.rb:190:in `each'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/base.rb:190:in `each_entry'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/base.rb:198:in `block in each_file'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/base.rb:197:in `each'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/base.rb:197:in `each_file'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/sprockets-2.1.2/lib/sprockets/base.rb:210:in `each_logical_path'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/actionpack-3.2.3/lib/sprockets/static_compiler.rb:18:in `compile'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/actionpack-3.2.3/lib/sprockets/assets.rake:56:in `internal_precompile'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/actionpack-3.2.3/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/victorstan/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/actionpack-3.2.3/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/victorstan/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/bin/rake:19:in `load'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/Users/victorstan/.rvm/rubies/ruby-1.9.3-p...]
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:80:in `ruby'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `ruby'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/actionpack-3.2.3/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/actionpack-3.2.3/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#popbottles/gems/actionpack-3.2.3/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/victorstan/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/lib/rake/app`enter code here`lication.rb:63:in `run'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/bin/rake:19:in `load'
/Users/victorstan/.rvm/gems/ruby-1.9.3-p125#global/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile
/Users/victorstan/Sites/pop_bottles ∴
You have an error in your pop_bottles/app/assets/javascripts/application.js. This is not a Heroku problem.

LoadError no such file when trying to load gems under rails

I'm getting a 'no such file' error when I try to require some gems in a rails console. Strangely, I don't get this error when requiring them in irb.
Thanks in advance.
$ irb
irb(main):001:0> $LOAD_PATH
=> ["/usr/local/lib/site_ruby/1.9.1", "/usr/local/lib/site_ruby/1.9.1/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.9.1", "/usr/lib/ruby/vendor_ruby/1.9.1/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.9.1", "/usr/lib/ruby/1.9.1/x86_64-linux"]
irb(main):002:0> require 'rubygems'
=> true
irb(main):003:0> require 'image_science'
=> true
irb(main):004:0> require 'mini_magick'
=> true
irb(main):005:0>
$ rails console
Loading development environment (Rails 3.0.5)
irb(main):001:0> require 'rubygems'
=> nil
irb(main):002:0> require 'image_science'
LoadError: no such file to load -- image_science
from /var/lib/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
...
from script/rails:6:in `require'
from script/rails:6:in `<main>'
irb(main):003:0> require 'mini_magick'
LoadError: no such file to load -- mini_magick
from /var/lib/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
...
from script/rails:6:in `require'
from script/rails:6:in `<main>'
irb(main):004:0> $LOAD_PATH
=> ["/var/lib/gems/1.9.1/gems/haml-3.0.25/vendor/fssm/lib", "/home/username/appname/lib", "/home/username/appname/vendor", "/home/username/appname/app/models", "/home/username/appname/app/mailers", "/home/username/appname/app/helpers", "/home/username/appname/app/controllers", "/var/lib/gems/1.9.1/gems/rails-3.0.5/lib", "/var/lib/gems/1.9.1/gems/railties-3.0.5/lib", "/var/lib/gems/1.9.1/gems/thor-0.14.6/lib", "/var/lib/gems/1.9.1/gems/pg-0.10.1/lib", "/var/lib/gems/1.9.1/gems/pg-0.10.1/ext", "/var/lib/gems/1.9.1/gems/oauth2-0.1.1/lib", "/var/lib/gems/1.9.1/gems/multi_json-0.0.5/lib", "/var/lib/gems/1.9.1/gems/haml-3.0.25/lib", "/var/lib/gems/1.9.1/gems/faraday-0.5.7/lib", "/var/lib/gems/1.9.1/gems/multipart-post-1.1.0/lib", "/var/lib/gems/1.9.1/gems/addressable-2.2.4/lib", "/var/lib/gems/1.9.1/gems/activeresource-3.0.5/lib", "/var/lib/gems/1.9.1/gems/activerecord-3.0.5/lib", "/var/lib/gems/1.9.1/gems/arel-2.0.9/lib", "/var/lib/gems/1.9.1/gems/actionmailer-3.0.5/lib", "/var/lib/gems/1.9.1/gems/mail-2.2.15/lib", "/var/lib/gems/1.9.1/gems/treetop-1.4.9/lib", "/var/lib/gems/1.9.1/gems/polyglot-0.3.1/lib", "/var/lib/gems/1.9.1/gems/mime-types-1.16/lib", "/var/lib/gems/1.9.1/gems/actionpack-3.0.5/lib", "/var/lib/gems/1.9.1/gems/tzinfo-0.3.24/lib", "/var/lib/gems/1.9.1/gems/rack-test-0.5.7/lib", "/var/lib/gems/1.9.1/gems/rack-mount-0.6.13/lib", "/var/lib/gems/1.9.1/gems/rack-1.2.1/lib", "/var/lib/gems/1.9.1/gems/erubis-2.6.6/lib", "/var/lib/gems/1.9.1/gems/activemodel-3.0.5/lib", "/var/lib/gems/1.9.1/gems/i18n-0.5.0/lib", "/var/lib/gems/1.9.1/gems/builder-2.1.2/lib", "/var/lib/gems/1.9.1/gems/activesupport-3.0.5/lib", "/var/lib/gems/1.9.1/gems/abstract-1.0.0/lib", "/var/lib/gems/1.9.1/gems/rake-0.8.7/lib", "/var/lib/gems/1.9.1/gems/bundler-1.0.10/lib", "/usr/local/lib/site_ruby/1.9.1", "/usr/local/lib/site_ruby/1.9.1/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.9.1", "/usr/lib/ruby/vendor_ruby/1.9.1/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.9.1", "/usr/lib/ruby/1.9.1/x86_64-linux", "/var/lib/gems/1.9.1/gems/actionpack-3.0.5/lib/action_controller/vendor/html-scanner", "/var/lib/gems/1.9.1/gems/rack-mount-0.6.13/lib/rack/mount/vendor/multimap", "/var/lib/gems/1.9.1/gems/rack-mount-0.6.13/lib/rack/mount/vendor/regin"]
Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.5'
gem 'pg'
gem 'oauth2'
gem 'haml'
You cannot require gems in Rails that are not in your Gemfile. You have to either include them in your Gemfile, or specify the full path to the gem when requiring, e.g. require "/full/path/to/gem".
This is because of the way Bundler works and overrides your existing load path. If you run $LOAD_PATH in the Rails console you'll see that it differs significantly from the one in IRB.