Ruby on Rails を導入

Ruby on Rails を導入してみようといくつかのサイトを見て apt-get で rubygems を入れたあと
gem install rails でOKなんて書いてあるから、楽勝と思って同じようにしてみても、どうも応答が帰ってこないでフリーズしてしまう。
メモリが192MBしかつんでいないので、それが原因かと思いながら、何回もトライ。
しょうがないので、ソースコードから入れることを決断し。ruby on Rails のサイトで rubugemsの1.3.1をダウンロードして,インストール。
この後、シンボリックリンクを
ln ?s /usr/bin/gem1.8 /usr/bin/gem

とした後、gem install rails でうまくインストールできそうな予感。

———————————————————————–debian:/tmp/rubygems-1.3.1# ruby setup.rb install
mkdir -p /usr/local/lib/site_ruby/1.8
mkdir -p /usr/bin
install -c -m 0644 rubygems.rb /usr/local/lib/site_ruby/1.8/rubygems.rb
install -c -m 0644 ubygems.rb /usr/local/lib/site_ruby/1.8/ubygems.rb
install -c -m 0644 rubygems/source_index.rb /usr/local/lib/site_ruby/1.8/rubygems/source_index.rb
install -c -m 0644

・・・・・・

Removing old RubyGems RDoc and ri
rm -rf /usr/local/rubygems/doc/rubygems-1.3.1
Installing rubygems-1.3.1 ri into /usr/local/rubygems/doc/rubygems-1.3.1/ri
Installing rubygems-1.3.1 rdoc into /usr/local/rubygems/doc/rubygems-1.3.1/rdoc

———————————————————————–

= Announce: RubyGems Release 1.3.0

NOTE:? RubyGems 1.1 and 1.2 have problems upgrading when there is no
rubygems-update installed.? You will need to follow the second set of update
instructions if you see “Nothing to update”.

Release 1.3.0 fixes some bugs.

Bugs fixed:

* Disregard ownership of ~ under Windows while creating ~/.gem.? Fixes
? issues related to no uid support under Windows.
* Fix requires for Gem::inflate, Gem::deflate, etc.
* Make Gem.dir respect :gemhome value from config.? (Note: this feature may be
? removed since it is hard to implement on 1.9.)
* Kernel methods are now private.? Patch #20801 by Stefan Rusterholz.
* Gem::location_of_caller now behaves on Windows.? Patch by Daniel Berger.
* Silence PATH warning.

Deprecation Notices:

* Gem::manage_gems will be removed on or after March 2009.

For a full list of changes to RubyGems and the contributor for each change, see
the ChangeLog file.

Special thanks to Chad Wooley for backwards compatibility testing and Luis
Lavena for continuing windows support.

== How can I get RubyGems?

NOTE:? If you have installed RubyGems using a package system you may want to
install a new RubyGems through the same packaging system.

If you have a recent version of RubyGems (0.8.5 or later), then all
you need to do is:

? $ gem update –system?? (you might need to be admin/root)

NOTE:? RubyGems 1.1 and 1.2 have problems upgrading when there is no
rubygems-update installed.? You will need to follow the second set of update
instructions if you see “Nothing to update”.

NOTE: You may have to run the command twice if you have any previosly
installed rubygems-update gems.

If you have an older version of RubyGems installed, then you can still
do it in two steps:

? $ gem install rubygems-update? (again, might need to be admin/root)
? $ update_rubygems????????????? (… here too)

If you don’t have any gems install, there is still the pre-gem
approach to getting software … doing it manually:

1. DOWNLOAD FROM: http://rubyforge.org/frs/?group_id=126
2. UNPACK INTO A DIRECTORY AND CD THERE
3. INSTALL WITH:? ruby setup.rb? (you may need admin/root privilege)

== To File Bugs

The RubyGems bug tracker can be found on RubyForge at:
http://rubyforge.org/tracker/?func=add&group_id=126&atid=575

When filing a bug, `gem env` output will be helpful in diagnosing the issue.

If you find a bug where RubyGems crashes, please provide debug output. You can
do that with `gem –debug the_command`.

== Thanks

Keep those gems coming!

— Jim & Chad & Eric (for the RubyGems team)

———————————————————————–

debian:/tmp/rubygems-1.3.1# export GEM_HOME=/usr/local/rubygems
debian:/tmp/rubygems-1.3.1# gem install rails –remote –include-dependencies
debian:/tmp/rubygems-1.3.1# which gem
/usr/bin/gem
debian:/tmp/rubygems-1.3.1# which gem1.8
/usr/bin/gem1.8
debian:/tmp/rubygems-1.3.1# ln -s /usr/bin/gem1.8 /usr/bin/gem?
debian:/tmp/rubygems-1.3.1# gem install rails –remote –include-dependencies
INFO:? `gem install -y` is now default and will be removed
INFO:? use –ignore-dependencies to install only the gems you list
Successfully installed rake-0.8.3
Successfully installed activesupport-2.2.2
Successfully installed activerecord-2.2.2
Successfully installed actionpack-2.2.2
Successfully installed actionmailer-2.2.2
Successfully installed activeresource-2.2.2
Successfully installed rails-2.2.2
7 gems installed
Installing ri documentation for rake-0.8.3…
Installing ri documentation for activesupport-2.2.2…
Installing ri documentation for activerecord-2.2.2…
Installing ri documentation for actionpack-2.2.2…
Installing ri documentation for actionmailer-2.2.2…
Installing ri documentation for activeresource-2.2.2…
Installing RDoc documentation for rake-0.8.3…
Installing RDoc documentation for activesupport-2.2.2…
Installing RDoc documentation for activerecord-2.2.2…
Installing RDoc documentation for actionpack-2.2.2…
Installing RDoc documentation for actionmailer-2.2.2…
Installing RDoc documentation for activeresource-2.2.2…
debian:/tmp/rubygems-1.3.1# rail -v
getopt: オプションが違います — v
Terminating…
debian:/home/gen/testrails# which rails
/usr/bin/rails
debian:/home/gen/testrails# cd ../?
debian:/home/gen/testrails# which rails
/usr/bin/rails
debian:/home/gen/testrails# rails -v
getopt: オプションが違います — v
Terminating…
debian:/usr/share# rails -v
bash: /usr/bin/rails: そのようなファイルやディレクトリはありません
debian:/usr/share# gem install rails
Successfully installed rails-2.2.2
1 gem installed
debian:/usr/share# cd /var/lib/gems/1.8/bin/
debian:/var/lib/gems/1.8/bin# rails -v
debian:/var/lib/gems/1.8/bin# cd /home/gen/testrails/
debian:/home/gen/testrails# ./script/server -b 192.168.10.160
./script/../config/boot.rb:16:in `require’: no such file to load — script/../config/../vendor/rails/railties/lib/initializer (LoadError)
??????? from ./script/../config/boot.rb:16
??????? from ./script/server:2:in `require’
??????? from ./script/server:2
debian:/home/gen/testrails# cd ../
debian:/home/gen# ls
Catalyst? boot.img.gz? dump.sql? idm??????? iptables? plagger????? sledge???? vmlinuz
Maildir?? db_dump????? ethna???? initrd.gz? mail????? privkey.pem? testrails? アプリケーション情報
debian:/home/gen# rm -R testrails/
debian:/home/gen# ls
Catalyst? boot.img.gz? dump.sql? idm??????? iptables? plagger????? sledge?? アプリケーション情報
Maildir?? db_dump????? ethna???? initrd.gz? mail????? privkey.pem? vmlinuz
debian:/home/gen# rails testrails
bash: /usr/bin/rails: そのようなファイルやディレクトリはありません
debian:/home/gen# rails -v
Rails 2.2.2
debian:/home/gen# rails testrails
????? create?
????? create? app/controllers
????? create? app/helpers
????? create? app/models
????? create? app/views/layouts
????? create? config/environments
????? create? config/initializers
????? create? config/locales
????? create? db
????? create? doc
????? create? lib
????? create? lib/tasks
????? create? log
????? create? public/images
????? create? public/javascripts
????? create? public/stylesheets
????? create? script/performance
????? create? script/process
????? create? test/fixtures
????? create? test/functional
????? create? test/integration
????? create? test/performance
????? create? test/unit
????? create? vendor
????? create? vendor/plugins
????? create? tmp/sessions
????? create? tmp/sockets
????? create? tmp/cache
????? create? tmp/pids
????? create? Rakefile
????? create? README
????? create? app/controllers/application.rb
????? create? app/helpers/application_helper.rb
????? create? test/test_helper.rb
????? create? test/performance/browsing_test.rb
????? create? config/database.yml
????? create? config/routes.rb
????? create? config/initializers/inflections.rb
????? create? config/initializers/mime_types.rb
????? create? config/initializers/new_rails_defaults.rb
????? create? config/locales/en.yml
????? create? config/boot.rb
????? create? config/environment.rb
????? create? config/environments/production.rb
????? create? config/environments/development.rb
????? create? config/environments/test.rb
????? create? script/about
????? create? script/console
????? create? script/dbconsole
????? create? script/destroy
????? create? script/generate
????? create? script/performance/benchmarker
????? create? script/performance/profiler
????? create? script/performance/request
????? create? script/process/reaper
????? create? script/process/spawner
????? create? script/process/inspector
????? create? script/runner
????? create? script/server
????? create? script/plugin
????? create? public/dispatch.rb
????? create? public/dispatch.cgi
????? create? public/dispatch.fcgi
????? create? public/404.html
????? create? public/422.html
????? create? public/500.html
????? create? public/index.html
????? create? public/favicon.ico
????? create? public/robots.txt
????? create? public/images/rails.png
????? create? public/javascripts/prototype.js
????? create? public/javascripts/effects.js
????? create? public/javascripts/dragdrop.js
????? create? public/javascripts/controls.js
????? create? public/javascripts/application.js
????? create? doc/README_FOR_APP
????? create? log/server.log
????? create? log/production.log
????? create? log/development.log
????? create? log/test.log
debian:/home/gen# cd testrails/
debian:/home/gen/testrails# gem install sqlite3-ruby
Building native extensions.? This could take a while…
ERROR:? Error installing sqlite3-ruby:
??????? ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install sqlite3-ruby
extconf.rb:1:in `require’: no such file to load — mkmf (LoadError)
??????? from extconf.rb:1

Gem files will remain installed in /usr/local/rubygems/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to /usr/local/rubygems/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
debian:/home/gen/testrails# apt-get install sqlite3-ruby
debian:/home/gen/testrails# cd ../
debian:/home/gen# gem install sqlite3-ruby
Building native extensions.? This could take a while…
ERROR:? Error installing sqlite3-ruby:
??????? ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install sqlite3-ruby
extconf.rb:1:in `require’: no such file to load — mkmf (LoadError)
??????? from extconf.rb:1

Gem files will remain installed in /usr/local/rubygems/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to /usr/local/rubygems/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out
debian:/home/gen# gem -v
1.3.1
debian:/home/gen# which gem
/usr/bin/gem
debian:/home/gen# which rails
/usr/bin/rails
debian:/home/gen# apt-get install libsqlite3-ruby?
? libsqlite3-ruby1.8?
? libsqlite3-ruby libsqlite3-ruby1.8
debian:/home/gen# apt-get install libsqlite3-dev
libsqlite3-dev はすでに最新バージョンです。
debian:/home/gen# apt-get install ruby1.8-dev?
? ruby1.8-dev
debian:/home/gen# gem install sqlite3-ruby
Building native extensions.? This could take a while…
Successfully installed sqlite3-ruby-1.2.4
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.4…
Installing RDoc documentation for sqlite3-ruby-1.2.4…
debian:/home/gen# cd testrails/

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です