[Rails][Ruby]環境構築

来源:互联网 发布:免费淘宝店招素材图片 编辑:程序博客网 时间:2024/06/11 10:03
[Rails][Ruby]環境構築だよーんCommentsAdd Star
  • Rubyインストール
    • http://rubyinstaller.org/から、ruby1.8.7-p358をダウンロード
    • 「Add Ruby executables to your PATH」をチェック
    • ruby -v
    • \Ruby187\bin
  • 環境変数
    • HTTP_PROXY=http://kenmituo.com:10080
    • HTTPS_PROXY=https://kenmituo.com:10080
  • Railsインストール

--> gem installrails -v 2.3.5

    • 2.3.5がインストールされる
  • mysqlドライバ

--> gem installmysql -- --with-mysql-config

    • mysql-2.8.1がインストールされた
  • MySQLDLLの入手と配置
    • http://sourceforge.jp/projects/sfnet_snpmonitor/downloads/libmysql.dll/からブラウザで入手
    • C:\Ruby-1.8.7\binフォルダ内にコピー
  • i18n_generator(多言語対応)のインストール

--> gem so -ahttp://gems.github.com

--> gem i amatsuda-i18n_generators

    • locale-2.0.5、gettext-2.2.0、amatsuda-i18n_generators-0.6.0が入る
  • calendar_date_select

-->gem install calendar_date_select

    • calendar_date_select_1.16.3がインストール
  • fastercsv

-->gem install fastercsv

    • fastercsv1.5.4がインストール
  • date2のインストール
    • http://www.funaba.org/ruby.html#date2からDL、date2-4.0.19.tar.gzをC:\Ruby-1.8.7\date2に展開
    • c:\Ruby187\date2\date2-4.0.19>ruby install.rb config
    • c:\Ruby187\date2\date2-4.0.19>ruby install.rb setup
    • c:\Ruby187\date2\date2-4.0.19>ruby install.rb install
  • jsonインストール
c:\Ruby187>gem install jsonERROR:  Error installing json:        The 'json' native gem requires installed build tools.Please update your PATH to include build tools or download the DevKitfrom 'http://rubyinstaller.org/downloads' and follow the instructionsat 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

あれ?

    • http://rubyinstaller.org/downloads/からDevelopment KitをDL
    • C:\Ruby187\DevKitに展開
c:\Ruby187>cd DevKitc:\Ruby187\DevKit>ruby dk.rb init[INFO] found RubyInstaller v1.8.7 at C:/Ruby187Initialization complete! Please review and modify the auto-generated'config.yml' file to ensure it contains the root directories to allof the installed Rubies you want enhanced by the DevKit.c:\Ruby187\DevKit>ruby dk.rb reviewBased upon the settings in the 'config.yml' file generatedfrom running 'ruby dk.rb init' and any of your customizations,DevKit functionality will be injected into the following Rubieswhen you run 'ruby dk.rb install'.C:/Ruby187c:\Ruby187\DevKit>ruby dk.rb install[INFO] Updating convenience notice gem override for 'C:/Ruby187'[INFO] Installing 'C:/Ruby187/lib/ruby/site_ruby/devkit.rb'
  • もういちどjsonインストール
c:\Ruby187>gem install jsonTemporarily enhancing PATH to include DevKit...Building native extensions.  This could take a while...Successfully installed json-1.6.61 gem installedInstalling ri documentation for json-1.6.6...Installing RDoc documentation for json-1.6.6...
  • mongrelインストール
c:\Ruby187>gem install mongrelFetching: gem_plugin-0.2.3.gem (100%)Fetching: cgi_multipart_eof_fix-2.5.0.gem (100%)Fetching: mongrel-1.1.5-x86-mingw32.gem (100%)Successfully installed gem_plugin-0.2.3Successfully installed cgi_multipart_eof_fix-2.5.0Successfully installed mongrel-1.1.5-x86-mingw323 gems installedInstalling ri documentation for gem_plugin-0.2.3...Installing ri documentation for cgi_multipart_eof_fix-2.5.0...Installing ri documentation for mongrel-1.1.5-x86-mingw32...Installing RDoc documentation for gem_plugin-0.2.3...Installing RDoc documentation for cgi_multipart_eof_fix-2.5.0...Installing RDoc documentation for mongrel-1.1.5-x86-mingw32...
  • MySQLインストール
    • http://www-jp.mysql.com/downloads/からMySQL Installer for Windows(AllMySQL Products.For AllWindows Platforms.InOne Package.)をDL、インストールして完了するとMysql-workbenchが起動するが英語
    • Mysql-workbench日本語化で日本語化

いつの間にか5.5になっている。

  • スタート>すべてのプログラムMySQL Installer>MySQL Installerで5.1を選択する
mysql -u root -pcreate database hoge_dev default character set utf8;

エラー

Aptanaでプロジェクトを作ったらでた

kenmituo@hoge ~/My Documents/Aptana Studio 3 Workspace/test $ rails .c:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)        from c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in`gem_original_require'        from c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in`require'        from c:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support.rb:56        from c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in`gem_original_require'        from c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in`require'        from c:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/bin/../lib/rails_generator.rb:28        from c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in`gem_original_require'        from c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in`require'        from c:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/bin/rails:14        from c:/Ruby187/bin/rails:19:in `load'        from c:/Ruby187/bin/rails:19

gemをダウングレード

c:\Ruby187>gem -v1.8.16c:\Ruby187>gem update --system 1.3.7Updating rubygems-updateFetching: rubygems-update-1.3.7.gem (100%)Successfully installed rubygems-update-1.3.7Installing RubyGems 1.3.7RubyGems 1.3.7 installed・ソ=== 1.3.7 / 2010-05-13NOTE:http://rubygems.org is now the default source for downloading gems.You may have sources set via ~/.gemrc, so you should replacehttp://gems.rubyforge.org with http://rubygems.orghttp://gems.rubyforge.org will continue to work for the forseeable future.New features:* `gem` commands  * `gem install` and `gem fetch` now report alternate platforms when a    matching one couldn't be found.  * `gem contents` --prefix is now the default as specified in --help.  Bug    #27211 by Mamoru Tasaka.  * `gem fetch` can fetch of old versions again.  Bug #27960 by Eric Hankins.  * `gem query` and friends output now lists platforms.  Bug #27856 by Greg    Hazel.  * `gem server` now allows specification of multiple gem dirs for    documentation.  Bug #27573 by Yuki Sonoda.  * `gem unpack` can unpack gems again.  Bug #27872 by Timothy Jones.  * `gem unpack` now unpacks remote gems.  * --user-install is no longer the default.  If you really liked it, see    Gem::ConfigFile to learn how to set it by default.  (This change was made    in 1.3.6)* RubyGems now has platform support for IronRuby.  Patch #27951 by Will Green.Bug fixes:* Require rubygems/custom_require if --disable-gem was set.  Bug #27700 by  Roger Pack.* RubyGems now protects against exceptions being raised by plugins.* rubygems/builder now requires user_interaction.  Ruby Bug #1040 by Phillip  Toland.* Gem::Dependency support #version_requirements= with a warning.  Fix for old  Rails versions.  Bug #27868 by Wei Jen Lu.* Gem::PackageTask depends on the package dir like the other rake package  tasks so dependencies can be hooked up correctly.------------------------------------------------------------------------------RubyGems installed the following executables:        C:/Ruby187/bin/gemRubyGems system software updatedc:\Ruby187>

Aptana>ファイル>新規>Railsプロジェクト

動いた!!!

  • willpaginateのインストール
c:\Ruby187>gem install mislav-will_paginate "~>2.2.3" --source http://gems.github.comSuccessfully installed mislav-will_paginate-2.3.11ERROR:  Could not find a valid gem '~>2.2.3' (>= 0) in any repository1 gem installedInstalling ri documentation for mislav-will_paginate-2.3.11...Installing RDoc documentation for mislav-will_paginate-2.3.11...

 

Subversion

ヘルプ>新規ソフトウェアインストール

作業対象>追加

  • Subclipse
  • http://subclipse.tigris.org/update_1.6.x/

作成した奴を選択すると3つ出てくる。

  • Optional JNA Library
  • Subclipse

次へ次へ

やっとかな?

Aptana>ウィンドウ>ビューの表示>その他>SVNSVNリポジトリー

ウィンドウが表示される

「新規リポジトリー・ロケーション」

なぜかSVNが2つある。

Aptana3にはプラグインマネージャーがないので大いに悩む。「すでにインストールされている」から「Aptana Studio 3インストール詳細」が起動する!

または

ヘルプ>Aptana Studio 3について>インストール詳細

わけもわからずに入れたeclipsのやつを削除する

リポジトリの登録

ウィンドウ>ビューの表示>その他>SVNSVNリポジトリ

SVNリポジトリの追加

原创粉丝点击