読者です 読者をやめる 読者になる 読者になる

悪あがきプログラマー

悪あがきを続けていきたい技術と書評なブログです。トレタでiOSエンジニアやってます。

Rails3 Could not find gem 'sqlite3-ruby (>= 0, runtime)' in any of the gem sources listed in your Gemfile.

scaffoldしようと思ったらまたもエラー

yoonchulkohs-MacBook-Pro:blog_app yoonchul$ rails g scaffold post title:string body:text
Could not find gem 'sqlite3-ruby (>= 0, runtime)' in any of the gem sources listed in your Gemfile.
Try running `bundle install`.

bundleをインストールしろと。
WEB+DB PRESSにはコマンドこれしか書いてなかったんだけどなぁ。
依存パッケージもまとめて自動的にインストールされるって書いてあったけど?

% gem i rails

インストール

yoonchulkohs-MacBook-Pro:blog_app yoonchul$ bundle install
Fetching source index for http://rubygems.org/
Enter your password to install the bundled RubyGems to your system: 
Using rake (0.8.7) 
Using abstract (1.0.0) 
Using activesupport (3.0.3) 
Using builder (2.1.2) 
Using i18n (0.5.0) 
Using activemodel (3.0.3) 
Using erubis (2.6.6) 
Using rack (1.2.1) 
Using rack-mount (0.6.13) 
Using rack-test (0.5.6) 
Using tzinfo (0.3.23) 
Using actionpack (3.0.3) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.9) 
Using mail (2.2.12) 
Using actionmailer (3.0.3) 
Using arel (2.0.6) 
Using activerecord (3.0.3) 
Using activeresource (3.0.3) 
Using bundler (1.0.7) 
Using thor (0.14.6) 
Using railties (3.0.3) 
Using rails (3.0.3) 
Installing sqlite3-ruby (1.3.2) with native extensions 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
yoonchulkohs-MacBook-Pro:blog_app yoonchul$ 

うん、できた。

yoonchulkohs-MacBook-Pro:blog_app yoonchul$ rails g scaffold post title:string body:text
      invoke  active_record
      create    db/migrate/20101215123920_create_posts.rb
      create    app/models/post.rb
      invoke    test_unit
      create      test/unit/post_test.rb
      create      test/fixtures/posts.yml
       route  resources :posts
      invoke  scaffold_controller
      create    app/controllers/posts_controller.rb
      invoke    erb
      create      app/views/posts
      create      app/views/posts/index.html.erb
      create      app/views/posts/edit.html.erb
      create      app/views/posts/show.html.erb
      create      app/views/posts/new.html.erb
      create      app/views/posts/_form.html.erb
      invoke    test_unit
      create      test/functional/posts_controller_test.rb
      invoke    helper
      create      app/helpers/posts_helper.rb
      invoke      test_unit
      create        test/unit/helpers/posts_helper_test.rb
      invoke  stylesheets
      create    public/stylesheets/scaffold.css
yoonchulkohs-MacBook-Pro:blog_app yoonchul$