roydu
2009-07-19 12:54
浏览 311
已采纳

关于openSUSE上的Ruby环境配置问题 ,清帮忙!!!

roy@localhost:~> rails -v
Rails 2.3.2
roy@localhost:~> gem -v
1.3.4
roy@localhost:~> ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]
roy@localhost:~> cd ~/Projects/
roy@localhost:~/Projects> cd emporium/

roy@localhost:~/Projects/emporium> ruby script/server
Missing the Rails 2.3.2 gem. Please gem install -v=2.3.2 rails, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
roy@localhost:~/Projects/emporium> gem install -v=2.3.2 rails
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- zlib (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:10
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/format.rb:9
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:11
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:3
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:4
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:167:in load_and_instantiate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:88:in
[]'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:144:in find_command'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:131:in
process_args'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:102:in run'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:58:in
run'
from /usr/local/bin/gem:21
roy@localhost:~/Projects/emporium>

上面好像说zlib没有?然后我 进入zlib1.2.3目录 ,执行如下:
roy@localhost:~/SoftTool/zlib-1.2.3> dir
总计 1204
-rw-r--r-- 1 roy users 4559 2004-12-22 adler32.c
-rw-r--r-- 1 roy users 1919 07-18 23:59 adler32.o
-rw-r--r-- 1 roy users 9336 2003-06-02 algorithm.txt
drwxr-xr-x 2 roy users 4096 2005-07-13 amiga
drwxr-xr-x 2 roy users 4096 2005-07-18 as400
-rw-r--r-- 1 roy users 42928 2005-07-18 ChangeLog
-rw-r--r-- 1 roy users 2489 2003-07-07 compress.c
-rw-r--r-- 1 roy users 1532 07-18 23:59 compress.o
-rwxr-xr-x 1 roy users 13167 2005-07-12 configure
drwxr-xr-x 22 roy users 4096 2005-07-18 contrib
-rw-r--r-- 1 roy users 13193 2005-06-13 crc32.c
-rw-r--r-- 1 roy users 30568 2003-01-06 crc32.h
-rw-r--r-- 1 roy users 11796 07-18 23:59 crc32.o
-rw-r--r-- 1 roy users 64163 2005-07-18 deflate.c
-rw-r--r-- 1 roy users 12114 2005-05-29 deflate.h
-rw-r--r-- 1 roy users 13588 07-18 23:59 deflate.o
-rwxr-xr-x 1 roy users 81552 07-18 23:59 example
-rw-r--r-- 1 roy users 16398 2004-10-24 example.c
-rw-r--r-- 1 roy users 9792 07-18 23:59 example.o
drwxr-xr-x 2 roy users 4096 2005-06-13 examples
-rw-r--r-- 1 roy users 15080 2004-11-27 FAQ
-rw-r--r-- 1 roy users 31103 2005-07-12 gzio.c
-rw-r--r-- 1 roy users 10080 07-18 23:59 gzio.o
-rw-r--r-- 1 roy users 1318 2004-10-04 INDEX
-rw-r--r-- 1 roy users 22164 2005-05-31 infback.c
-rw-r--r-- 1 roy users 9964 07-18 23:59 infback.o
-rw-r--r-- 1 roy users 12568 2004-11-13 inffast.c
-rw-r--r-- 1 roy users 407 2003-01-02 inffast.h
-rw-r--r-- 1 roy users 2512 07-18 23:59 inffast.o
-rw-r--r-- 1 roy users 6343 2002-11-25 inffixed.h
-rw-r--r-- 1 roy users 48977 2005-06-15 inflate.c
-rw-r--r-- 1 roy users 5916 2004-11-13 inflate.h
-rw-r--r-- 1 roy users 15716 07-18 23:59 inflate.o
-rw-r--r-- 1 roy users 13756 2005-07-18 inftrees.c
-rw-r--r-- 1 roy users 2373 2005-07-11 inftrees.h
-rw-r--r-- 1 roy users 4044 07-18 23:59 inftrees.o
-rw-r--r-- 1 roy users 90428 07-18 23:59 libz.a
-rw-r--r-- 1 roy users 4141 07-18 23:59 Makefile
-rw-r--r-- 1 roy users 4133 2005-07-18 Makefile.in
-rw------- 1 roy users 13234 2005-07-13 make_vms.com
-rwxr-xr-x 1 roy users 81411 07-18 23:59 minigzip
-rw-r--r-- 1 roy users 8018 2005-05-28 minigzip.c
-rw-r--r-- 1 roy users 4516 07-18 23:59 minigzip.o
drwxr-xr-x 2 roy users 4096 2003-08-29 msdos
drwxr-xr-x 3 roy users 4096 2005-07-13 old
drwxr-xr-x 3 roy users 4096 2004-10-24 projects
drwxr-xr-x 2 roy users 4096 2005-07-18 qnx
-rw-r--r-- 1 roy users 5696 2005-07-18 README
-rw-r--r-- 1 roy users 44027 2005-06-13 trees.c
-rw-r--r-- 1 roy users 8444 1998-02-24 trees.h
-rw-r--r-- 1 roy users 14600 07-18 23:59 trees.o
-rw-r--r-- 1 roy users 2087 2003-07-07 uncompr.c
-rw-r--r-- 1 roy users 1212 07-18 23:59 uncompr.o
drwxr-xr-x 2 roy users 4096 2005-07-18 win32
-rw-r--r-- 1 roy users 9544 07-18 23:59 zconf.h
-rw-r--r-- 1 roy users 9544 2005-05-28 zconf.in.h
-rw-r--r-- 1 roy users 4486 2005-07-18 zlib.3
-rw-r--r-- 1 roy users 66188 2005-07-18 zlib.h
-rw-r--r-- 1 roy users 7136 2005-06-13 zutil.c
-rw-r--r-- 1 roy users 6859 2005-07-12 zutil.h
-rw-r--r-- 1 roy users 1556 07-18 23:59 zutil.o
roy@localhost:~/SoftTool/zlib-1.2.3> ./configure
Checking for gcc...
Building static library libz.a version 1.2.3 with gcc.
Checking for unistd.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for errno.h... Yes.
Checking for mmap support... Yes.
roy@localhost:~/SoftTool/zlib-1.2.3> make
gcc -O3 -DUSE_MMAP -c -o example.o example.c
gcc -O3 -DUSE_MMAP -c -o adler32.o adler32.c
gcc -O3 -DUSE_MMAP -c -o compress.o compress.c
gcc -O3 -DUSE_MMAP -c -o crc32.o crc32.c
gcc -O3 -DUSE_MMAP -c -o gzio.o gzio.c
gcc -O3 -DUSE_MMAP -c -o uncompr.o uncompr.c
gcc -O3 -DUSE_MMAP -c -o deflate.o deflate.c
gcc -O3 -DUSE_MMAP -c -o trees.o trees.c
gcc -O3 -DUSE_MMAP -c -o zutil.o zutil.c
gcc -O3 -DUSE_MMAP -c -o inflate.o inflate.c
gcc -O3 -DUSE_MMAP -c -o infback.o infback.c
gcc -O3 -DUSE_MMAP -c -o inftrees.o inftrees.c
gcc -O3 -DUSE_MMAP -c -o inffast.o inffast.c
ar rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
gcc -O3 -DUSE_MMAP -o example example.o -L. libz.a
gcc -O3 -DUSE_MMAP -c -o minigzip.o minigzip.c
gcc -O3 -DUSE_MMAP -o minigzip minigzip.o -L. libz.a
roy@localhost:~/SoftTool/zlib-1.2.3> make install
cp zlib.h zconf.h /usr/local/include
cp: 无法创建普通文件“/usr/local/include/zlib.h”: 权限不够
cp: 无法创建普通文件“/usr/local/include/zconf.h”: 权限不够
make: *** [install] 错误 1
roy@localhost:~/SoftTool/zlib-1.2.3> su
口令:
localhost:/home/roy/SoftTool/zlib-1.2.3 # make install
cp zlib.h zconf.h /usr/local/include
chmod 644 /usr/local/include/zlib.h /usr/local/include/zconf.h
cp libz.a /usr/local/lib
cd /usr/local/lib; chmod 755 libz.a
cd /usr/local/lib; if test -f libz.so.1.2.3; then \
rm -f libz.so libz.so.1; \
ln -s libz.so.1.2.3 libz.so; \
ln -s libz.so.1.2.3 libz.so.1; \
(ldconfig || true) >/dev/null 2>&1; \
fi
cp zlib.3 /usr/local/share/man/man3
chmod 644 /usr/local/share/man/man3/zlib.3
localhost:/home/roy/SoftTool/zlib-1.2.3 #

上面显示这个 是不是算安装 zlib成功了?然后我运行这个还是出错:
roy@localhost:~/Projects/emporium> gem install -v=2.3.2 rails
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- zlib (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:10
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/format.rb:9
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:11
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:3
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:4
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:167:in load_and_instantiate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:88:in
[]'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:144:in find_command'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:131:in
process_args'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:102:in run'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:58:in
run'
from /usr/local/bin/gem:21
roy@localhost:~/Projects/emporium>

怎么办??????????????

[b]问题补充:[/b]
谢谢 !zlib 解决了 ,但又找不到openssl了!

我安openssl了,但在ruby/ext/openssl里不能make。

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • xenocide 2009-07-19 15:41
    已采纳

    [quote]上面显示这个 是不是算安装 zlib成功了?[/quote]
    应该是。但还缺 ruby 对的 libz 封装。

    找到 ruby 的源码目录,转入 ext/zlib/,
    [code="console"]ruby extconf.rb
    make && make install[/code]

    点赞 打赏 评论

相关推荐 更多相似问题