[问题]郁闷呀,使用rails出现下面提示,貌似大伙都比较顺利没有出现俺类似的错误。

软件和网站开发以及相关技术探讨
回复
themyth
帖子: 67
注册时间: 2007-08-23 21:17

[问题]郁闷呀,使用rails出现下面提示,貌似大伙都比较顺利没有出现俺类似的错误。

#1

帖子 themyth » 2008-05-25 11:40

郑重声明:俺是菜鸟,学习rails纯粹是兴趣,如有雷同纯属巧合。
但是对俺打击也太大了,连续在几种linux环境下安装都不成功。
两个星期了,找了n多个论坛,第一次rails demo 执行完毕后,以下是提示:
-----------郁闷的分割线-----------
themyth@themyth:~$ ruby -v
ruby 1.9.0 (2007-12-25 revision 14709) [i686-linux]
themyth@themyth:~$ gem -v
1.1.1
themyth@themyth:~$ rails -v
Rails 2.0.2
themyth@themyth:~$ cd work
themyth@themyth:~/work$ sudo rails depot
[sudo] password for themyth:
can't convert Enumerable::Enumerator into Array #介个是什么意思?
themyth@themyth:~/work$ cd demo
themyth@themyth:~/work/demo$ ls
app db lib public README test vendor config doc log Rakefile script tmp
themyth@themyth:~/work/demo$ ruby script/server
/home/themyth/work/demo/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb:3:in `require': no such file to load -- base64 (LoadError)
from /home/themyth/work/demo/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb:3:in `<top (required)>'
from /home/themyth/work/demo/vendor/rails/activesupport/lib/active_support/core_ext/hash.rb:2:in `require'
from /home/themyth/work/demo/vendor/rails/activesupport/lib/active_support/core_ext/hash.rb:2:in `block in <top (required)>'
from /home/themyth/work/demo/vendor/rails/activesupport/lib/active_support/core_ext/hash.rb:1:in `each'
from /home/themyth/work/demo/vendor/rails/activesupport/lib/active_support/core_ext/hash.rb:1:in `<top (required)>'
from /home/themyth/work/demo/vendor/rails/activesupport/lib/active_support/core_ext.rb:3:in `require'
from /home/themyth/work/demo/vendor/rails/activesupport/lib/active_support/core_ext.rb:3:in `block in <top (required)>'
from /home/themyth/work/demo/vendor/rails/activesupport/lib/active_support/core_ext.rb:1:in `each'
from /home/themyth/work/demo/vendor/rails/activesupport/lib/active_support/core_ext.rb:1:in `<top (required)>'
from /home/themyth/work/demo/vendor/rails/activesupport/lib/active_support.rb:30:in `require'
from /home/themyth/work/demo/vendor/rails/activesupport/lib/active_support.rb:30:in `<top (required)>'
from /home/themyth/work/demo/vendor/rails/railties/lib/commands/server.rb:1:in `require'
from /home/themyth/work/demo/vendor/rails/railties/lib/commands/server.rb:1:in `<top (required)>'
from script/server:3:in `require'
from script/server:3:in `<main>
'
themyth@themyth:~/work/demo$
-是的,当时的情况就是这样-----------



我的profile有加以下:
-------------
RUBY_HOME=/usr/local/bin/ruby
PATH="${RUBY_HOME}"/bin:"${JAVA_HOME}"/bin:/usr/local/mysql/bin:"${PATH}"
export PATH
------------------
-------------
themyth
帖子: 67
注册时间: 2007-08-23 21:17

#2

帖子 themyth » 2008-05-26 22:10

还是没有人理我,好几天了,还是解决不了问题,肯定哪里一个很简单的地方没有搞懂。
大侠,救命!!
18106127
帖子: 22
注册时间: 2007-06-06 20:56
来自: 黑龙江省 鹤岗
联系:

#3

帖子 18106127 » 2008-06-30 17:39

唉 貌似我连rails 都没装成。。 非常郁闷 在学习RUBY中
头像
toawinner47
帖子: 200
注册时间: 2006-11-08 20:46
联系:

安装Ruby&Rails

#4

帖子 toawinner47 » 2008-07-20 2:04

1. Rails的框架是基于Ruby语言的,就像Struts框架是基于Java一样,所以先去下载Ruby安装包,http://rubyinstaller.rubyforge.org。也可以在ubuntu中用打开终端输入命令:

代码: 全选

sudo apt-get install ruby
接着安装Rails:

代码: 全选

sudo apt-get install rails

代码: 全选

sudo apt-get install libapache2-mod-ruby libapache2-mod-fcgid libfcgi-ruby1.8 libmocha-ruby1.8

代码: 全选

sudo apt-get install mongrel

代码: 全选

 mkdir /home/hbs/work

代码: 全选

cd /home/hbs/work

代码: 全选

rails demo

代码: 全选

 cd demo/script

代码: 全选

./server webrick
图片
2.访问web页面

如上图图中的第三行告诉我们rails的web服务端口号是3000,访问地址为http://127.0.0.1:3000

如果访问成功会得到如下画面:
图片
附件
rubyrails6.png
rubyrails4.png
头像
toawinner47
帖子: 200
注册时间: 2006-11-08 20:46
联系:

#5

帖子 toawinner47 » 2008-07-20 3:50

经典Helloworld
附件
rubyrails7.png
头像
karron
帖子: 6226
注册时间: 2005-06-11 14:03
来自: 不明真相的群众
联系:

#6

帖子 karron » 2008-07-20 9:05

rails 要使用官方的, 不要用ubuntu源里面的.

另外, 不要随便使用sudo.
sudo rails depot 这句话是明显错误的. 在自己目录里面不要使用sudo.
我的blog,关于技术,软件,linux,vim <---- 所有博客均被河蟹.
回复