Topic: rails generate scaffold

I just tried to do rails generate scaffold User name:string email:string
and i am getting errors

invoke  active_record
/Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.3/lib/bundler/rubygems_integration.rb:157:in `block in replace_gem': Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (can't activate sqlite3 (~> 1.3.5), already activated sqlite3-1.3.3. Make sure all dependencies are added to Gemfile.) (LoadError)
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activerecord-3.2.3/lib/active_record/connection_adapters/sqlite3_adapter.rb:3:in `<top (required)>'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:48:in `resolve_hash_connection'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:39:in `resolve_string_connection'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:23:in `spec'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:127:in `establish_connection'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activerecord-3.2.3/lib/active_record/railtie.rb:76:in `block (2 levels) in <class:Railtie>'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:42:in `each'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activerecord-3.2.3/lib/active_record/base.rb:721:in `<top (required)>'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/railties-3.2.3/lib/rails/generators/named_base.rb:162:in `pluralize_table_names?'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/railties-3.2.3/lib/rails/generators/named_base.rb:110:in `table_name'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activerecord-3.2.3/lib/rails/generators/active_record/model/model_generator.rb:17:in `create_migration_file'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/invocation.rb:109:in `invoke'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/group.rb:269:in `block in _invoke_for_class_method'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/shell.rb:74:in `with_padding'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/group.rb:258:in `_invoke_for_class_method'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/group.rb:150:in `_invoke_from_option_orm'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/railties-3.2.3/lib/rails/generators.rb:170:in `invoke'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/railties-3.2.3/lib/rails/commands/generate.rb:12:in `<top (required)>'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
  from /Users/moiseszaragoza/.rvm/gems/ruby-1.9.3-p125@demo_app/gems/railties-3.2.3/lib/rails/commands.rb:29:in `<top (required)>'
  from script/rails:6:in `require'
  from script/rails:6:in `<main>'

Last edited by moiseszaragoza (2012-05-10 10:57:26)

Re: rails generate scaffold

i see that this wants me to install
gem install activerecord-sqlite3-adapter

when i try to run this it says

ERROR:  Could not find a valid gem 'activerecord-sqlite3-adapter' (>= 0) in any repository

Gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.3'
#gem 'sqlite3', '1.3.3'
gem 'sqlite3'
# 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'

Last edited by moiseszaragoza (2012-05-10 11:45:42)

Re: rails generate scaffold

i dont know what i did but i stated a new app and it just worked