wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p0.tar.gz
tar xvf ruby-1.9.1-p0.tar.gz
cd ruby-1.9.1-p0
./configure
失敗
C compiler cannot create executables
安裝 libc6-dev
apt-get install libc6-dev
重作-安裝 ruby
./configure
失敗
make: command not found
安裝 make
apt-get install make
重作-安裝 ruby
./configure
make
make insatll
ruby -v
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]
完成安裝 ruby
安裝 rake rack
gem install rake rack
失敗
/usr/local/lib/ruby/1.9.1/rubygems/package.rb:10:in `require': no such file to load -- zlib (LoadError)
安裝 zlib ruby adaptor
cd ruby-1.9.1-p0
cd ext
cd zlib
ruby extconf.rb
失敗
checking for deflateReset() in -lz... no
checking for deflateReset() in -llibz... no
checking for deflateReset() in -lzlib... no
*** extconf.rb failed ***
安裝 zlib1g-dev
apt-get install zlib1g-dev
重作-安裝 zlib ruby adaptor
ruby extconf.rb
make
make install
重作-安裝 rake rack
gem install rake rack
安裝 rails 2.3.1
gem install rails --source http://gems.rubyonrails.org
gem list
*** LOCAL GEMS ***
actionmailer (2.3.1)
actionpack (2.3.1)
activerecord (2.3.1)
activeresource (2.3.1)
activesupport (2.3.1)
rack (0.9.1)
rails (2.3.1)
rake (0.8.4)
完成安裝 rails
建新網站
rails blog -d mysql
cd blog
啟動
./script/server
失敗 /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.1/lib/initializer.rb:269:in `rescue in require_frameworks': no such file to load -- openssl (RuntimeError)
安裝 openssl ruby adaptor
cd ruby-1.9.1-p0
cd ext
cd openssl
ruby extconf.rb
失敗
=== OpenSSL for Ruby configurator ===
=== Checking for system dependent stuff... ===
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for assert.h... yes
=== Checking for required stuff... ===
checking for openssl/ssl.h... no
=== Checking for required stuff failed. ===
Makefile wasn't created. Fix the errors above.
安裝 libssl-dev
apt-get install libssl-dev
重作-安裝 openssl ruby adaptor
ruby extconf.rb
make
make install
重新啟動網站
./script/server
網頁ok
http://localhost:30000/
About your aplication's environment
Internal Server Error undefined method `each' for #
console 顯示
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql. /!\ FAILSAFE /!\ 2009-03-09 10:27:58 -0700 Status: 500 Internal Server Error no such file to load -- mysql
安裝 mysql ruby adaptor
wget http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.8.1.tar.gz
tar xvf mysql-ruby-2.8.1.tar.gz
cd mysql-ruby-2.8.1
ruby extconf.rb
失敗 checking for mysql_query() in -lmysqlclient... no *** extconf.rb failed ***
安裝 libmysql++-dev
apt-get install libmysql++-dev
重新安裝 mysql ruby adaptor
ruby extconf.rb
make
make install
重新啟動網站
./script/server
Status: 500 Internal Server Error Access denied for user 'root'@'localhost' (using password: NO)
ok~正常,這是 database.yml 沒設定的關係
改好後重啟網站
./script/server
完工^^;