rvmで複数のrubyを管理する
rvmを使ってruby 1.9.2をインストールしてみました。
rvmは、複数のバージョンのRubyをインストールし管理するするツールです
rubyのインストールや、バージョンの異なるrubyを切り替えて使用することが出来ます。
続きはアトトックラボで
http://www.atotok.com/labo/ruby/20110409230438.html
Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in your Gemfile.
昨日の、Rails3をインストールの続きです。
試しにコマンドラインから、rake db:create:allを実行すると同様のメッセージが表示される。
$ rake db:create:all (in /Users/kuru/NetBeansProjects/RailsTest1) Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in your Gemfile.
Gemfileを確認すると下記のようになっている。
Gemfile
source 'http://rubygems.org' gem 'rails', '3.0.6' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' gem 'sqlite3' # Use unicorn as the web server # gem 'unicorn' # Deploy with Capistrano # gem 'capistrano' # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+) # gem 'ruby-debug' # gem 'ruby-debug19', :require => 'ruby-debug' # Bundle the extra gems: # gem 'bj' # gem 'nokogiri' # gem 'sqlite3-ruby', :require => 'sqlite3' # gem 'aws-s3', :require => 'aws/s3' # 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
bundle installしてみる。
$ bundle install Fetching source index for http://rubygems.org/ /Users/kuru/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler.rb:207: warning: Insecure world writable dir /usr/local in PATH, mode 040777 Using rake (0.8.7) Using abstract (1.0.0) Using activesupport (3.0.6) Using builder (2.1.2) Using i18n (0.5.0) Using activemodel (3.0.6) Using erubis (2.6.6) Using rack (1.2.2) Using rack-mount (0.6.14) Using rack-test (0.5.7) Using tzinfo (0.3.26) Using actionpack (3.0.6) Using mime-types (1.16) Using polyglot (0.3.1) Using treetop (1.4.9) Using mail (2.2.15) Using actionmailer (3.0.6) Using arel (2.0.9) Using activerecord (3.0.6) Using activeresource (3.0.6) Using bundler (1.0.12) Using thor (0.14.6) Using railties (3.0.6) Using rails (3.0.6) Installing sqlite3 (1.3.3) with native extensions Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
この状態で、rake db:create:allを実行するとSQLite3のDBが作成された。
$ rake db:create:all (in /Users/kuru/NetBeansProjects/RailsTest1) /Users/kuru/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /usr/local in PATH, mode 040777 db/development.sqlite3 already exists db/test.sqlite3 already exists db/production.sqlite3 already exists
development.sqlite3、production.sqlite3、test.sqlite3が作成されている。
$ ls db development.sqlite3 production.sqlite3 seeds.rb test.sqlite3
NetBeansでもbundle install
Railsプロジェクトを右クリックし、メニューから「Bundler」->「install」を選択しbundle installを実行する。
bundlerのコンソール出力
Fetching source index for http://rubygems.org/ Using rake (0.8.7) Using abstract (1.0.0) Using activesupport (3.0.6) Using builder (2.1.2) Using i18n (0.5.0) Using activemodel (3.0.6) Using erubis (2.6.6) Using rack (1.2.2) Using rack-mount (0.6.14) Using rack-test (0.5.7) Using tzinfo (0.3.26) Using actionpack (3.0.6) Using mime-types (1.16) Using polyglot (0.3.1) Using treetop (1.4.9) Using mail (2.2.15) Using actionmailer (3.0.6) Using arel (2.0.9) Using activerecord (3.0.6) Using activeresource (3.0.6) Using bundler (1.0.12) Using thor (0.14.6) Using railties (3.0.6) Using rails (3.0.6) Installing sqlite3 (1.3.3) with native extensions Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
この状態で、NetBeansかRailsのアプリケーションを起動するとRailsのWelcomeページが表示される。
とりあえず動いているようだが、プロジェクトの作成時のエラーはどうなったのか?
NetBeansでRailsのプロジェクトを作成してみると、
プロジェクト作成時に表示されていたメッセージも出なくなった。
とりあえず、これでOKか