Posts Tagged ‘Mysql’

NetBeansチュートリアル

月曜日, 11月 24th, 2008

■1.DB作成
windowsコマンドプロンプトから

mysqladmin -u root -p create rubyweblog_development

■2.新規プロジェクト作成

■3.database.ymlを編集
DB設定に沿って、[構成]以下のdatabase.ymlを編集

■4.モデルを作成
「モデル」ノードを右クリックし、「生成」
「引数」フィールドに「Post title:string」と入力
 →postモデルが生成される。

モデルが扱うpostsテーブルをコントロールするマイグレーションファイルも作成される。
(テーブル名は複数系になる)

■5.マイグレーション設定
001_create_posts.rbの編集

class CreatePosts < ActiveRecord::Migration

def self.up
create_table :posts do |t|
t.column :title, :string
end
end

def self.down
drop_table :posts
end
end

プロジェクト名上で、右クリックして
「データベースマイグレーション」>「現在のバージョンへ」

■6.コントローラの編集
「コントローラ」ノードを右クリックし、「生成」
名前フィールドに Blog と入力し、「生成」

class BlogController < ApplicationController
scaffold :post ←これを追加
end

■7.routes.rbの編集

# map.connect '', :controller => “welcome”

map.connect ”, :controller => “blog”

index.htmlは削除しておく。

■8.プロジェクトの動作確認
メニューより、「主プロジェクトの実行」を選択してテスト。

■9.テキストエリアの追加
「データベースマイグレーション」ノードを右クリックし、「生成」
「引数」フィールドで、AddBody を入力して「了解」

def self.up の下に行を追加し、「mcol」と入力して Tab キー
カラム追加用のコードテンプレートが表示されるので、Tabキーで移動して、それぞれの内容を追記

add_column :posts, :body, :text

プロジェクト名上で、右クリックして
「データベースマイグレーション」>「現在のバージョンへ」

Tags: ,
Posted in Programing | No Comments »

20081011やること、やった事

日曜日, 10月 26th, 2008

・編集
・トップ編集
・リンク応募

・rubyインストール

Ubuntu 8.04.1でRuby on Railsを動かす – public class oui : Panda

http://d.hatena.ne.jp/oui27/20081001/1222878827

Yano lablog – 第6回 Ubuntu入門 ~Ruby on Railsのセットアップ~

http://anoy.cspc.jp/?p=80

・MySQLインストール

[S] Semantic Log: 【Ubuntu】 LAMP (Linux, Apache2, MySQL, Python)一発インストール

http://semanticlog.blogspot.com/2008/03/ubuntu-lamp-linux-apache2-mysql.html

・デモ作成

・プリンタセットアップ

・cocoyaソースをプリントアウト

Tags: ,
Posted in PC・Server設定 | No Comments »

Lenovo note NetBeans開発環境

日曜日, 8月 24th, 2008

Lenovo note NetBeans開発環境

ruby インストール
・One-Click Ruby
ruby186-26.exe

システム環境変数の”path”に追加
;C:\ruby\bin

・MySQL
mysql-essential-5.0.51b-win32.msi

default character を utf8 に変更
Include Bin Directory in Windows PATHにチェックオン

・Rails
gemsでインストール

> gem install rails

c:\ruby>gem install rails
Bulk updating Gem source index for: http://gems.rubyforge.org
Install required dependency rake? [Yn] Y
Install required dependency activesupport? [Yn] Y
Install required dependency activerecord? [Yn] Y
Install required dependency actionpack? [Yn] Y
Install required dependency actionmailer? [Yn] Y
Install required dependency activeresource? [Yn] Y
Successfully installed rails-2.1.0
Successfully installed rake-0.8.1
Successfully installed activesupport-2.1.0
Successfully installed activerecord-2.1.0
Successfully installed actionpack-2.1.0
Successfully installed actionmailer-2.1.0
Successfully installed activeresource-2.1.0
Installing ri documentation for rake-0.8.1…
Installing ri documentation for activesupport-2.1.0…
Installing ri documentation for activerecord-2.1.0…
Installing ri documentation for actionpack-2.1.0…
Installing ri documentation for actionmailer-2.1.0…
Installing ri documentation for activeresource-2.1.0…
Installing RDoc documentation for rake-0.8.1…
Installing RDoc documentation for activesupport-2.1.0…
Installing RDoc documentation for activerecord-2.1.0…
Installing RDoc documentation for actionpack-2.1.0…
Installing RDoc documentation for actionmailer-2.1.0…
Installing RDoc documentation for activeresource-2.1.0…

c:\ruby>gem install rails
Successfully installed rails-2.1.0

インストール許可を省略する際には”-y”オプション
> gem install rails -y

1.2系をインストールする場合は以下参照

> gem install rails –version=”1.2.6″ -y

C:\Documents and Settings\Miyai>mysql –version
mysql Ver 14.12 Distrib 5.0.51b, for Win32 (ia32)

C:\Documents and Settings\Miyai>rails -v
Rails 2.1.0

C:\Documents and Settings\Miyai>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

・NetBeansインストール
JDKが必要

http://java.sun.com/j2se/1.5.0/ja/download.html

netbeans-6.1-ml-ruby-windows.exe
※mlはマルチランゲージの事。日本語版を含みます。

チュートリアル

http://www.netbeans.org/kb/60/ruby/rapid-ruby-weblog_ja.html

■なぜか、データベースが作成できない。
C:\Documents and Settings\Miyai>mysqladmin -u root -p create rubyweblog_developm
ent
Enter password: ********
mysqladmin: CREATE DATABASE failed; error: ‘Can’t create database ‘rubyweblog_de
velopment’; database exists’

C:\Documents and Settings\Miyai>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> quit;
Bye

C:\Documents and Settings\Miyai>mysqladmin -u root -p create rubyweblog_developm
ent
Enter password: ********
mysqladmin: CREATE DATABASE failed; error: ‘Can’t create database ‘rubyweblog_de
velopment’; database exists’

C:\Documents and Settings\Miyai>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> quit;
Bye

C:\Documents and Settings\Miyai>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> create database rubyweblog_development;
ERROR 1007 (HY000): Can’t create database ‘rubyweblog_development’; database exi
sts

■どうやら同名のデータベースがある模様。(アンインストール失敗していた?)
mysql> show databases;
+————————+
| Database |
+————————+
| information_schema |
| depot_development |
| mysql |
| rubyweblog_development |
| test |
+————————+
5 rows in set (0.23 sec)

■不要なデータベースを削除
mysql> drop database depot_development;
Query OK, 2 rows affected (0.33 sec)

mysql> drop database rubyweblog_development;
Query OK, 0 rows affected (0.00 sec)

mysql> drop database test;
Query OK, 0 rows affected (0.02 sec)

mysql> quit;
Bye

■無事作成できた。
C:\Documents and Settings\Miyai>mysqladmin -u root -p create rubyweblog_development
Enter password: ********

C:\Documents and Settings\Miyai>

■しかし、チュートリアルどおり進まない。
rails1.2系と、rails2.0系の違い

教えて! Watch Ruby on Rails について

http://oshiete1.watch.impress.co.jp/qa4070054.html

始める。 ・テンプレートファイルの名称がXXX.rhtmlからXXX.html.erbに変更 ってとこです。

http://yamamoto.xrea.jp/2008/02/ruby-on-rails-20scaffold.php

——————————————————-
1.railsコマンドでひな形を作成
※rails2.0ではデフォルトのDBがSQLite3なので、mysqlで使う場合は”-d mysql”オプションが必要かもです。
2.database.ymlを修正
3.おもむろにscaffold実行
ruby script/generate scaffold pepole name:string age:integer
4.dbにデータベースを作る
5.mygrateする
rake db:migrate
6.serverをスタートする
——————————————————-

NetBeansのチュートリアル手順を改造するとこんな感じか
——————————————————-
1.db内にデータベース作成する。
2.初期ウィザードで、Mysql指定(これでdatabase.ymlも自動生成)
3.scaffold生成
4.mygrationファイル修正
5.mygrate
6.実行!
——————————————————-

明日やってみる。

Tags: , ,
Posted in Programing | No Comments »

restful_authentication導入その1

金曜日, 8月 22nd, 2008

昨日の手順に従って実施。

1.DBの作成

C:\Documents and Settings\Miyai>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> create database rubyweblog_development;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+————————+
| Database |
+————————+
| information_schema |
| mysql |
| rubyweblog_development |
+————————+
3 rows in set (0.00 sec)

mysql>

2.railsプロジェクトの作成

rubyweblog作った!

3. restful_authentication プラグインのインストール

$ ./script/plugin discover

C:\Documents and Settings\Miyai\My Documents\NetBeansProjects\rubyweblog>ruby script/plugin discover
Add http://www.agilewebdevelopment.com/plugins/? [Y/n] Y
Add svn://rubyforge.org/var/svn/expressica/plugins/? [Y/n] Y
Add http://soen.ca/svn/projects/rails/plugins/? [Y/n] Y
Add http://technoweenie.stikipad.com/plugins/? [Y/n] Y
Add http://svn.techno-weenie.net/projects/plugins/? [Y/n] Y
Add http://svn.recentrambles.com/plugins/? [Y/n] Y
Add http://opensvn.csie.org/rails_file_column/plugins/? [Y/n] Y
Add http://svn.protocool.com/public/plugins/? [Y/n] Y
Add http://tools.assembla.com/svn/breakout/breakout/vendor/plugins/? [Y/n] Y
Add http://svn.pragprog.com/Public/plugins/? [Y/n] Y
Add http://source.collectiveidea.com/public/rails/plugins/? [Y/n] Y
Add https://secure.near-time.com/svn/plugins/? [Y/n] Y
Add http://svn.inlet-media.de/svn/rails_extensions/plugins/? [Y/n] Y
Add http://svn.viney.net.nz/things/rails/plugins/? [Y/n] y
Add http://svn.hasmanythrough.com/public/plugins/? [Y/n] y
Add http://svn.shiftnetwork.com/plugins/? [Y/n] y
Add svn://caboo.se/plugins/? [Y/n] y
Add http://svn.6brand.com/projects/plugins/? [Y/n] y
Add http://shanesbrain.net/svn/rails/plugins/? [Y/n] y
Add svn://errtheblog.com/svn/plugins/? [Y/n] y
Add http://svn.nkryptic.com/plugins/? [Y/n] y
Add http://svn.thoughtbot.com/plugins/? [Y/n] y
Add http://svn.webwideconsulting.com/plugins/? [Y/n] y
Add http://invisible.ch/svn/projects/plugins/? [Y/n] y
Add svn://rubyforge.org/var/svn/enum-column/plugins/? [Y/n] y
Add http://hivelogic.com/plugins/? [Y/n] y
Add http://mattmccray.com/svn/rails/plugins/? [Y/n] y
Add svn://rubyforge.org/var/svn/cartographer/plugins/? [Y/n] y
Add http://www.svn.recentrambles.com/plugins/? [Y/n] y
Add http://tanjero.com/svn/plugins/? [Y/n] y
Add http://filetofsole.org/svn/public/projects/rails/plugins/? [Y/n] y
Add http://topfunky.net/svn/plugins/? [Y/n] y
Add svn://rubyforge.org/var/svn/agtools/plugins/? [Y/n] y
Add http://svn.aviditybytes.com/rails/plugins/? [Y/n] y
Add http://beautifulpixel.textdriven.com/svn/plugins/? [Y/n] y
Add http://mabs29.googlecode.com/svn/trunk/plugins/? [Y/n] y
Add http://www.codyfauser.com/svn/projects/plugins/? [Y/n] y
Add http://craz8.com/svn/trunk/plugins/? [Y/n] y
Add http://sean.treadway.info/svn/plugins/? [Y/n] y
Add http://svn.thebootstrapnation.com/public/plugins/? [Y/n] y
Add http://www.mattmccray.com/svn/rails/plugins/? [Y/n] y
Add svn://rubyforge.org//var/svn/validaterequest/plugins/? [Y/n] y
Add http://sprocket.slackworks.com/svn/rails/plugins/? [Y/n] y
Add http://svn.simpltry.com/plugins/? [Y/n] y
Add http://svn.elctech.com/svn/public/plugins/? [Y/n] y
Add http://xmlblog.stikipad.com/plugins/? [Y/n] y
Add http://www.xml-blog.com/svn/plugins/? [Y/n] y
Add http://svn.toolbocks.com/plugins/? [Y/n] y
Add http://thar.be/svn/projects/plugins/? [Y/n] y
Add http://code.teytek.com/rails/plugins/? [Y/n] y
Add http://www.infused.org/svn/plugins/? [Y/n] y
Add svn://rubyforge.org/var/svn/apptrain/trunk/vendor/plugins/? [Y/n] y
Add http://s3cachestore.googlecode.com/svn/trunk/plugins/? [Y/n] y
Add http://sbecker.net/shared/plugins/? [Y/n] y
Add http://opensvn.csie.org/macaque/plugins/? [Y/n] y
Add http://svn.designbyfront.com/rails/plugins/? [Y/n] y
Add http://svn.rails-engines.org/plugins/? [Y/n] y
Add http://john.guen.in/svn/plugins/? [Y/n] y
Add http://www.redhillonrails.org/svn/trunk/vendor/plugins/? [Y/n] y
Add svn://rubyforge.org/var/svn/actsdisjoint/plugins/? [Y/n] y
Add http://ajaxmessaging.googlecode.com/svn/trunk/plugins/? [Y/n] y
Add http://mod-i18n.googlecode.com/svn/trunk/plugins/? [Y/n] y
Add svn://majakari.net/public/rails/plugins/? [Y/n] y
Add http://svn.devjavu.com/malaysia-rb/plugins/? [Y/n] y
Add http://svn.railslodge.com/svn/plugins/? [Y/n] y
Add http://flouzometer.rubyforge.org/svn/trunk/plugins/? [Y/n] y
Add svn://svn.spattendesign.com/svn/plugins/? [Y/n] y
Add http://rails.sanityinc.com/plugins/? [Y/n] y
Add http://svn.savvica.com/public/plugins/? [Y/n] y
Add https://svn01.allmyfunds.com.au/svn/public/plugins/? [Y/n] y
Add http://svn.megablaix.com/plugins/? [Y/n] y
Add http://to-json-options.rubyforge.org/svn/trunk/plugins/? [Y/n] y
Add http://rails-multifielddate-plugin.googlecode.com/svn/plugins/? [Y/n] y
Add http://flexible-rails.googlecode.com/svn/trunk/plugins/? [Y/n] y
Add http://sql-helper.rubyforge.org/svn/trunk/plugins/? [Y/n] y
Add http://winnscriptatype.rubyforge.org/svn/plugins/? [Y/n] y
Add svn://furtherin.net/rails/plugins/? [Y/n] y
Add http://dectxn.rubyforge.org/svn/tags/CURRENT/plugins/? [Y/n] y

$ ./script/plugin install restful_authentication

C:\Documents and Settings\Miyai\My Documents\NetBeansProjects\rubyweblog>ruby script/plugin install restful_authentication
+ ./README
+ ./Rakefile
+ ./generators/authenticated/USAGE
+ ./generators/authenticated/authenticated_generator.rb
+ ./generators/authenticated/templates/activation.html.erb
+ ./generators/authenticated/templates/authenticated_system.rb
+ ./generators/authenticated/templates/authenticated_test_helper.rb
+ ./generators/authenticated/templates/controller.rb
+ ./generators/authenticated/templates/fixtures.yml
+ ./generators/authenticated/templates/functional_spec.rb
+ ./generators/authenticated/templates/functional_test.rb
+ ./generators/authenticated/templates/helper.rb
+ ./generators/authenticated/templates/login.html.erb
+ ./generators/authenticated/templates/mailer.rb
+ ./generators/authenticated/templates/mailer_test.rb
+ ./generators/authenticated/templates/migration.rb
+ ./generators/authenticated/templates/model.rb
+ ./generators/authenticated/templates/model_controller.rb
+ ./generators/authenticated/templates/model_functional_spec.rb
+ ./generators/authenticated/templates/model_functional_test.rb
+ ./generators/authenticated/templates/model_helper.rb
+ ./generators/authenticated/templates/observer.rb
+ ./generators/authenticated/templates/signup.html.erb
+ ./generators/authenticated/templates/signup_notification.html.erb
+ ./generators/authenticated/templates/unit_spec.rb
+ ./generators/authenticated/templates/unit_test.rb
+ ./install.rb
+ ./lib/restful_authentication/rails_commands.rb
Restful Authentication Generator
====

This is a basic restful authentication generator for rails, taken
from acts as authenticated. Currently it requires Rails 1.2.6 or above.

To use:

./script/generate authenticated user sessions \
–include-activation \
–stateful

The first parameter specifies the model that gets created in signup
(typically a user or account model). A model with migration is
created, as well as a basic controller with the create method.

The second parameter specifies the sessions controller name. This is
the controller that handles the actual login/logout function on the
site.

The third parameter (–include-activation) generates the code for a
ActionMailer and its respective Activation Code through email.

The fourth (–stateful) builds in support for acts_as_state_machine
and generates activation code. This was taken from:

http://www.vaporbase.com/postings/stateful_authentication

You can pass –skip-migration to skip the user migration.

If you’re using acts_as_state_machine, define your users resource like this:

map.resources :users, :member => { :suspend => :put,
:unsuspend => :put,
:purge => :delete }

Also, add an observer to config/environment.rb if you chose the
–include-activation option

config.active_record.observers = :user_observer # or whatever you

# named your model

Security Alert
====

I introduced a change to the model controller that’s been tripping
folks up on Rails 2.0. The change was added as a suggestion to help
combat session fixation attacks. However, this resets the Form
Authentication token used by Request Forgery Protection. I’ve left
it out now, since Rails 1.2.6 and Rails 2.0 will both stop session
fixation attacks anyway.

■おまけ
> ruby script/plugin discover
は、リポジトリの追加

Rails Wiki – プラグイン
Plugins in Ruby on Rails

今日はここまで

Tags: ,
Posted in Programing | No Comments »

Rails2.0でscaffoldする。

火曜日, 8月 19th, 2008

Rails2.0の壁にぶち当たった昨日の続き。

昨日の「こうすりゃいんじゃね?」まとめ。
——————————————————-
1.db内にデータベース作成する。
2.初期ウィザードで、Mysql指定(これでdatabase.ymlも自動生成)
3.scaffold生成
4.mygrationファイル修正
5.mygrate
6.実行!
——————————————————-

で、今日やってみました。
おおむねOK

忘れないうちに備忘録
——————————————————-
■1.db内にデータベース作成する。

C:\Documents and Settings\Miyai>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> drop database rubyweblog_development;
Query OK, 2 rows affected (0.64 sec)

mysql> create database rubyweblog_development;
Query OK, 1 row affected (0.03 sec)

mysql> quit;
Bye

昨日のゴミDBを消して、作っただけ。

■2.初期ウィザードで、Mysql指定(これでdatabase.ymlも自動生成)

NetBeansのプロジェクト作成ウィザードで指定しただけ。(簡単!)

■3.scaffold生成

プロジェクト名を右クリック→「生成」を選択

生成で「scaffold」を選択
名前で「Post title:string」を入力
「了解」ボタンを選択

■4.mygrationファイル修正

修正不要。勝手にgenerateしてくれています。

■5.mygrate

プロジェクト名を右クリック>データベースマイグレーション>現在のバージョン

■6.実行!
失敗!

#良く考えたら、構成とかの編集忘れてました。

■7.構成の編集
<appフォルダ>\config\routes.rb の編集
# map.root :controller => “welcome”

map.root :controller => “posts”

※ここで指定するコントローラ名は複数系。これで軽くはまりました。

■8.デフォルトindexファイル削除
<appフォルダ>\public\index.html を削除

■9.再実行
OK!
——————————————————-

ってか、1.2系より、よっぽど簡単。これは2.0で開発進めるべきか。。。
#自動生成されているソースもわかりやすくなっている。マイグレーションファイル名が、タイムスタンプになってたりとか
#20080818225201_create_posts.rb

Tags: , ,
Posted in Programing | No Comments »

MysqlでDatabase作成

月曜日, 8月 18th, 2008

NetBeansのチュートリアルに沿って、初期プロジェクトを作成したが、Databaseの作成に失敗する。

■なぜか、データベースが作成できない。
C:\Documents and Settings\Miyai>mysqladmin -u root -p create rubyweblog_development
Enter password: ********
mysqladmin: CREATE DATABASE failed; error: ‘Can’t create database ‘rubyweblog_development’; database exists’

C:\Documents and Settings\Miyai>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> quit;
Bye

C:\Documents and Settings\Miyai>mysqladmin -u root -p create rubyweblog_development
Enter password: ********
mysqladmin: CREATE DATABASE failed; error: ‘Can’t create database ‘rubyweblog_development’; database exists’

C:\Documents and Settings\Miyai>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> quit;
Bye

C:\Documents and Settings\Miyai>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> create database rubyweblog_development;
ERROR 1007 (HY000): Can’t create database ‘rubyweblog_development’; database exists

■どうやら、すでに同名のデータベースがある模様。(アンインストールに失敗していた?)
mysql> show databases;
+————————+
| Database |
+————————+
| information_schema |
| depot_development |
| mysql |
| rubyweblog_development |
| test |
+————————+
5 rows in set (0.23 sec)

■不要なデータベースを削除
mysql> drop database depot_development;
Query OK, 2 rows affected (0.33 sec)

mysql> drop database rubyweblog_development;
Query OK, 0 rows affected (0.00 sec)

mysql> drop database test;
Query OK, 0 rows affected (0.02 sec)

mysql> quit;
Bye

■無事作成できた。
C:\Documents and Settings\Miyai>mysqladmin -u root -p create rubyweblog_development
Enter password: ********

C:\Documents and Settings\Miyai>

Tags: ,
Posted in Cocoya.net, Programing | No Comments »

NotePC NetBeans開発環境

月曜日, 8月 18th, 2008

NotePCに Ruby on Rails のNetBeans開発環境を構築する。

■ruby インストール
・One-Click Ruby
ruby186-26.exe

システム環境変数の”path”にrubyのpathを追加
;C:\ruby\bin

■MySQL
mysql-essential-5.0.51b-win32.msi

・default character を utf8 に変更
・Include Bin Directory in Windows PATHにチェックオン

■Rails
gemsでインストール

> gem install rails

c:\ruby>gem install rails
Bulk updating Gem source index for: http://gems.rubyforge.org
Install required dependency rake? [Yn] Y
Install required dependency activesupport? [Yn] Y
Install required dependency activerecord? [Yn] Y
Install required dependency actionpack? [Yn] Y
Install required dependency actionmailer? [Yn] Y
Install required dependency activeresource? [Yn] Y
Successfully installed rails-2.1.0
Successfully installed rake-0.8.1
Successfully installed activesupport-2.1.0
Successfully installed activerecord-2.1.0
Successfully installed actionpack-2.1.0
Successfully installed actionmailer-2.1.0
Successfully installed activeresource-2.1.0
Installing ri documentation for rake-0.8.1…
Installing ri documentation for activesupport-2.1.0…
Installing ri documentation for activerecord-2.1.0…
Installing ri documentation for actionpack-2.1.0…
Installing ri documentation for actionmailer-2.1.0…
Installing ri documentation for activeresource-2.1.0…
Installing RDoc documentation for rake-0.8.1…
Installing RDoc documentation for activesupport-2.1.0…
Installing RDoc documentation for activerecord-2.1.0…
Installing RDoc documentation for actionpack-2.1.0…
Installing RDoc documentation for actionmailer-2.1.0…
Installing RDoc documentation for activeresource-2.1.0…

c:\ruby>gem install rails
Successfully installed rails-2.1.0

#インストール許可を省略する際には”-y”オプション
> gem install rails -y

#1.2系をインストールする場合は以下参照
> gem install rails –version=”1.2.6″ -y

■プログラムインストール結果
C:\Documents and Settings\Miyai>mysql –version
mysql Ver 14.12 Distrib 5.0.51b, for Win32 (ia32)

C:\Documents and Settings\Miyai>rails -v
Rails 2.1.0

C:\Documents and Settings\Miyai>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

■NetBeansインストール
JDKが必要
Java SE Downloads

NetBeans 日本語サイト
ja: NetBeans 日本語サイト
netbeans-6.1-ml-ruby-windows.exe
※mlはマルチランゲージの事。日本語版を含みます。

■チュートリアル
Ruby のブログを 10 分で作成 – NetBeans IDE 6.0 チュートリアル

Tags: , , ,
Posted in PC・Server設定 | No Comments »

Get Adobe Flash playerPlugin by wpburn.com wordpress themes