DeviseCreateUsers: migrating create_table(:users) rake aborted - ruby-on-rails-3

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.

Related

Scaffolding with bootstrap:themed is throwing application error

Used rails to generate new project.
Added twitter-bootstrap-rails to Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.8'
# Use thin as webserver
gem 'thin'
# Mysql
gem 'mysql2'
# 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', :platforms => :ruby
gem "less-rails"
gem 'uglifier', '>= 1.0.3'
end
# Twitter bootstrap baby
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
# json
gem 'json'
# jQuery is the win
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Devise for auth goodness
gem 'devise'
# Cancan for permission goodness
gem 'cancan'
# Fog allows for easy communication with clouds
gem 'fog'
group :development, :test do
# Cannot run as gem and use heroku
# See: http://stackoverflow.com/questions/6288910/heroku-deployment-gemfile-lock-problem
# gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
gem 'faker'
gem 'factory_girl_rails'
gem 'rspec-rails'
gem 'shoulda-matchers'
gem 'capybara'
gem 'launchy'
gem 'database_cleaner'
gem 'guard-rspec'
end
#
# group :production do
# gem 'pg'
# end
Did a bundle install, all went well.
Then I did
$ rails g bootstrap:install
Still all is good.
Next, did this:
$ rails g bootstrap:layout application fixed
still good.
Then I did this:
$ rails g bootstrap:themed Posts
and got this:
/Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize': uninitialized constant Post (NameError)
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:59:in `block in columns'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:69:in `rescue_block'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns'
from (erb):9:in `template'
from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `eval'
from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `result'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:111:in `block in template'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `call'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `render'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:47:in `identical?'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:73:in `on_conflict_behavior'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:130:in `invoke_with_conflict_check'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:61:in `invoke!'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:26:in `create_file'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:110:in `template'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:97:in `block in generate_erb'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `generate_erb'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:92:in `generate_views'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:19:in `copy_views'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/generators.rb:171:in `invoke'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/generate.rb:12:in `<top (required)>'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands.rb:29:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
/Volumes/dev/projects/jason/fuckthis $ rails g bootstrap:themed posts
/Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize': uninitialized constant Post (NameError)
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:59:in `block in columns'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:69:in `rescue_block'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns'
from (erb):9:in `template'
from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `eval'
from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `result'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:111:in `block in template'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `call'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `render'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:47:in `identical?'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:73:in `on_conflict_behavior'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:130:in `invoke_with_conflict_check'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:61:in `invoke!'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:26:in `create_file'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:110:in `template'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:97:in `block in generate_erb'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `generate_erb'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:92:in `generate_views'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:19:in `copy_views'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/generators.rb:171:in `invoke'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/generate.rb:12:in `<top (required)>'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands.rb:29:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
/Volumes/dev/projects/jason/fuckthis $ rails g bootstrap:themed posts -f
/Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize': uninitialized constant Post (NameError)
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:59:in `block in columns'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:69:in `rescue_block'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns'
from (erb):9:in `template'
from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `eval'
from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `result'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:111:in `block in template'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `call'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `render'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:47:in `identical?'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:73:in `on_conflict_behavior'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:130:in `invoke_with_conflict_check'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:61:in `invoke!'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:26:in `create_file'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:110:in `template'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:97:in `block in generate_erb'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `generate_erb'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:92:in `generate_views'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:19:in `copy_views'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/generators.rb:171:in `invoke'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/generate.rb:12:in `<top (required)>'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands.rb:29:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I have rolled back to twitter-bootstrap-rails 2.1.5 and 2.1.4 to no avail.
Please advise.
You need to create the Post scaffold first. From https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/README.md:
rails g scaffold Post title:string description:text
rake db:migrate
rails g bootstrap:themed Posts

undefined method `database_authenticatable' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x9dee690>

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.

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.

rails generate rspec:install - no such file to load -- sqlite3/sqlite3_native (LoadError)

I'm trying to follow this tutorial, and when I try to use the RSpec generator
$ rails generate rspec:install
I get the following error:
/usr/lib/ruby/gems/1.8/gems/sqlite3-1.3.5/lib/sqlite3.rb:6:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)
from /usr/lib/ruby/gems/1.8/gems/sqlite3-1.3.5/lib/sqlite3.rb:6
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `each'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `each'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
from /home/rcooke/sample_app/config/application.rb:13
from /usr/lib/ruby/gems/1.8/gems/railties-3.2.2/lib/rails/commands.rb:24:in `require'
from /usr/lib/ruby/gems/1.8/gems/railties-3.2.2/lib/rails/commands.rb:24
from script/rails:6:in `require'
from script/rails:6
Following the other discussions on this same problem, I have changed my Gemfile to contain the following:
group :development, :test do
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'sqlite3', '1.3.5'
gem 'rspec-rails'
gem 'rspec'
end
I added both rspec and rspec-rails to the Gemfile after noticing they are both installed:
Using rspec-core (2.9.0)
Using rspec-expectations (2.9.0)
Using rspec-mocks (2.9.0)
Using rspec (2.9.0)
Using rspec-rails (2.9.0)
I've even carried out:
$ gem install rspec
Maybe i'm not using the correct procedure to update. Once I've saved the Gemfile on my computer i'm using bundle update and bundle install. Trying rails generate rspec:install still fails.
Update: when I try to run the resource i get the following error:
$ rake spec
rake aborted!
no such file to load -- sqlite3/sqlite3_native
Update: I've obviously screwed something up. Now if I attempt to start a new application I get the following error.
$ rails new sample_app2 --skip-test-unit
/usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find json (~> 1.4) amongst [actionmailer-3.2.2, actionpack-3.2.2, activemodel-3.2.2, activerecord-3.2.2, activeresource-3.2.2, activesupport-3.2.2, addressable-2.2.7, arel-3.0.2, builder-3.0.0, bundler-1.1.3, bundler-1.1.2, coffee-rails-3.2.2, coffee-script-2.2.0, coffee-script-source-1.2.0, diff-lcs-1.1.3, erubis-2.7.0, execjs-1.3.0, heroku-2.22.0, heroku-2.21.3, hike-1.2.1, i18n-0.6.0, journey-1.0.3, jquery-rails-2.0.1, json_pure-1.6.6, launchy-2.1.0, mail-2.4.4, mime-types-1.18, multi_json-1.2.0, multi_json-1.1.0, netrc-0.7.1, polyglot-0.3.3, rack-1.4.1, rack-cache-1.2, rack-ssl-1.3.2, rack-test-0.6.1, rails-3.2.2, railties-3.2.2, rake-0.9.2.2, rdoc-3.12, rest-client-1.6.7, rspec-2.9.0, rspec-core-2.9.0, rspec-expectations-2.9.0, rspec-mocks-2.9.0, rspec-rails-2.9.0, rubyzip-0.9.6.1, sass-3.1.15, sass-rails-3.2.5, sprockets-2.3.1, sprockets-2.1.2, sqlite3-1.3.5, sqlite3-ruby-1.3.3, thor-0.14.6, tilt-1.3.3, treetop-1.4.10, tzinfo-0.3.32, uglifier-1.2.3] (Gem::LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:772:in `activate_dependencies'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:761:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:761:in `activate_dependencies'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:745:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:775:in `activate_dependencies'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:761:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:761:in `activate_dependencies'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:745:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1211:in `gem'
from /usr/bin/rails:18
Do you have the SQlite3 library installed on your system? When you look in /usr/lib/ for libsqlite3.so (assuming you're on Linux) do you see it? if not then could you try installing it (via apt-get/portage/your package manager) and see if that helps.

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.