无法使用 RVM 安装 Webiva
我正在尝试安装 Webiva (Rails CMS)
我正在使用 RVM 来管理我的 Ruby 版本,目前我有Ubuntu 10.04 上的 1.8.7 和 1.9.2 (我对 Linux 还很陌生,所以不要对我太苛刻 =P)
我一直在关注 本教程。要安装 Webiva,我需要运行 ./script/quick_install.rb
,但它失败并抛出以下内容
<internal:lib/rubygems/custom_require>:29:in `require’: no such file to load — sha1 (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require’
from ./script/quick_install.rb:3:in `<main>’
,我相信是因为我的主文件夹中安装了 ruby 和 rubygems(由于 RVM)。
知道如何安装 Webiva 吗?可能我需要修改该脚本以指向安装 Ruby 的正确位置。但不知道到底如何......
这是脚本的第一行:
#!/usr/bin/env ruby
require 'sha1'
require 'base64'
require 'fileutils'
require 'yaml'
require 'rubygems'
require 'memcache'
RAILS_ROOT = File.dirname(__FILE__) + "/.."
def run_db_command(command,use_db=true)
if use_db
system("mysql",'-u',@username,"--password=#{@pw}","--host=#{@db_host}","--port=#{@db_port}",'-e',command,@db_name)
else
system("mysql",'-u',@username,"--password=#{@pw}","--host=#{@db_host}","--port=#{@db_port}",'-e',command)
end
end
class WebivaQuickInstall
...
和 这里是完整来源
谢谢
I'm trying to install Webiva (a Rails CMS)
I’m using RVM to manage my Ruby versions, I currently have 1.8.7 and 1.9.2 on Ubuntu 10.04 (I'm pretty new at Linux, so don't be too hard on me =P)
I've been following this tutorial. To install Webiva I need to run ./script/quick_install.rb
, but it fails throwing the following
<internal:lib/rubygems/custom_require>:29:in `require’: no such file to load — sha1 (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require’
from ./script/quick_install.rb:3:in `<main>’
I believe is because I have ruby and rubygems installed in my home folder (because of RVM).
Any idea of how can I install Webiva anyway? Probably I need to modify that script to point to the right place where Ruby is installed. But don't know how really...
Here are the first lines of the script:
#!/usr/bin/env ruby
require 'sha1'
require 'base64'
require 'fileutils'
require 'yaml'
require 'rubygems'
require 'memcache'
RAILS_ROOT = File.dirname(__FILE__) + "/.."
def run_db_command(command,use_db=true)
if use_db
system("mysql",'-u',@username,"--password=#{@pw}","--host=#{@db_host}","--port=#{@db_port}",'-e',command,@db_name)
else
system("mysql",'-u',@username,"--password=#{@pw}","--host=#{@db_host}","--port=#{@db_port}",'-e',command)
end
end
class WebivaQuickInstall
...
And here is the full source
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 rvm 中,某些模块(例如 Readline 和 OpenSSL)默认情况下不会编译到 ruby 中。运行 rvm 安装程序后,必须将它们安装为模块。缺少的 sha1 库是由 OpenSSL 提供的,因此您应该安装 OpenSSL ruby 扩展。
您可以在
/home//.rvm//ext/openssl
中找到这些文件。在该目录中运行以下两个命令:假设您有适当的 OpenSSL 开发库,这将配置 ruby 扩展,并且您将能够继续安装。如果第一步产生错误,那么您需要从包管理器中获取 OpenSSL 开发库。如果我自己的经验没记错的话,该包名为
openssl-devel
。In rvm, certain modules like Readline and OpenSSL aren't compiled into ruby by default. These must be installed as modules after you run the rvm installer. The missing sha1 library is provided by OpenSSL, so you should install the OpenSSL ruby extension.
You can find the files in
/home/<user>/.rvm/<ruby_version>/ext/openssl
. Run the following two commands in that directory:Assuming you have the proper development libraries for OpenSSL, this will configure the ruby extension and you'll be able to continue with the install. If the first step produces errors, then you'll need to grab the OpenSSL development libraries from your package manager. If I remember correctly from my own experience, that package is named
openssl-devel
.我已经结束使用 /doc 目录中的 ubuntu 安装程序脚本。
I've ended using the ubuntu installer script from /doc dir.