Leopard下Ruby1.9.2及Rails3折腾记
花了半天时间捣鼓了Ruby1.9.2的在Leopard下的安装,费了些时间,遇到了一些自己遇上的问题及解决办法,更新上去,好了,废话不说了
cd /usr/local/src/ curl -O http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.gz tar -xzvf ruby-1.9.2-p0.tar.gz cd ruby-1.9.2-p0 sudo ./configure --program-suffix=19 --enable-shared --with-readline-dir=/usr/local make make test sudo make install
然后可以去喝杯茶,或者看看其他网站了,需要编译一段时间,我关注.configure 的时候出现了个error
checking whether OS depend dynamic link works... In file included from /usr/local/include/fuse/fuse.h:26,
from <command line>:1:
/usr/local/include/fuse/fuse_common.h:32:2: error: #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
In file included from /usr/local/include/fuse/fuse.h:857,
from <command line>:1:
/usr/local/include/fuse/fuse_compat.h:69:24: error: sys/statfs.h: No such file or directory
安装完成
ruby -v ruby 1.9.2p0 (2010-08-18 revision 29036) [i386-darwin9.5.0]
但是gem有问题会报下面的错误
gem list /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:68:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError) from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:58:in `from_installed_gems' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:944:in `source_index' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:84:in `init_gemspecs' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:19:in `initialize' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:889:in `new' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:889:in `block in searcher' from <internal:prelude>:10:in `synchronize' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:888:in `searcher' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:528:in `find_files' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1132:in `<top (required)>' from <internal:lib/rubygems/custom_require>:29:in `require' from <internal:lib/rubygems/custom_require>:29:in `require' from /usr/local/bin/gem:8:in `<main>'
查了很多资料,重新编译了几遍 还是报这个error,无奈求助Google大神,发现ruby-forum上有人有解决方法
Dear everyone having Gem.path issues: I compile manually. Install to /usr/local. Pretty standard. I had 1.9.2 preview 3 installed. I installed 1.9.2p0, got the Gem.path error. Here's the simple solution that worked for me: nuke the gems, make install again. sudo rm -rf /usr/local/lib/ruby/site_ruby/1.9.1/*ubygem* cd your-ruby-src-path sudo make install # assuming you have it compiled from before
无奈尝试了下 死马当活马医吧,按照上面的提示删了ruby1.9.1下所有的*ubygem* 重新编译了下,问题解决了,但是还是搞不清楚为啥会报这个gem 错误,在Ubuntu下就没任何问题.谁知道原因麻烦看到了告诉我,谢谢.
OK,向rails3挺进
sudo gem install rails Successfully installed activesupport-3.0.0 Successfully installed builder-2.1.2 Successfully installed i18n-0.4.1 Successfully installed activemodel-3.0.0 Successfully installed rack-1.2.1 Successfully installed rack-test-0.5.4 Successfully installed rack-mount-0.6.12 Successfully installed tzinfo-0.3.23 Successfully installed abstract-1.0.0 Successfully installed erubis-2.6.6 Successfully installed actionpack-3.0.0 Successfully installed arel-1.0.1 Successfully installed activerecord-3.0.0 Successfully installed activeresource-3.0.0 Successfully installed mime-types-1.16 Successfully installed polyglot-0.3.1 Successfully installed treetop-1.4.8 Successfully installed mail-2.2.5 Successfully installed actionmailer-3.0.0 Successfully installed thor-0.14.0 Successfully installed railties-3.0.0 Successfully installed bundler-1.0.0 Successfully installed rails-3.0.0 23 gems installed Installing ri documentation for activesupport-3.0.0... Installing ri documentation for builder-2.1.2... Installing ri documentation for i18n-0.4.1... Installing ri documentation for activemodel-3.0.0... Installing ri documentation for rack-1.2.1... Installing ri documentation for rack-test-0.5.4... Installing ri documentation for rack-mount-0.6.12... Installing ri documentation for tzinfo-0.3.23... Installing ri documentation for abstract-1.0.0... Installing ri documentation for erubis-2.6.6... Installing ri documentation for actionpack-3.0.0... Installing ri documentation for arel-1.0.1... Installing ri documentation for activerecord-3.0.0... Installing ri documentation for activeresource-3.0.0... Installing ri documentation for mime-types-1.16... Installing ri documentation for polyglot-0.3.1... Installing ri documentation for treetop-1.4.8... Installing ri documentation for mail-2.2.5... Installing ri documentation for actionmailer-3.0.0... Installing ri documentation for thor-0.14.0... Installing ri documentation for railties-3.0.0... Installing ri documentation for bundler-1.0.0... Installing ri documentation for rails-3.0.0... Installing RDoc documentation for activesupport-3.0.0... Installing RDoc documentation for builder-2.1.2... Installing RDoc documentation for i18n-0.4.1... Installing RDoc documentation for activemodel-3.0.0... Installing RDoc documentation for rack-1.2.1... Installing RDoc documentation for rack-test-0.5.4... Installing RDoc documentation for rack-mount-0.6.12... Installing RDoc documentation for tzinfo-0.3.23... Installing RDoc documentation for abstract-1.0.0... Installing RDoc documentation for erubis-2.6.6... Installing RDoc documentation for actionpack-3.0.0... Installing RDoc documentation for arel-1.0.1... Installing RDoc documentation for activerecord-3.0.0... Installing RDoc documentation for activeresource-3.0.0... Installing RDoc documentation for mime-types-1.16... Installing RDoc documentation for polyglot-0.3.1... Installing RDoc documentation for treetop-1.4.8... Installing RDoc documentation for mail-2.2.5... Installing RDoc documentation for actionmailer-3.0.0... Installing RDoc documentation for thor-0.14.0... Installing RDoc documentation for railties-3.0.0... Installing RDoc documentation for bundler-1.0.0... Installing RDoc documentation for rails-3.0.0...
完毕,下来就是又一轮的学习了,话说这次rails的改进是巨大的,哈哈 有的玩了.
另外推荐点rails3的视频学习资料Rails 3.0 Released (And 22 Free Videos To Bring You Up To Speed) http://adjix.com/4qyr 有兴趣的可以去看看.

还没有评论.