在Debian上安装Webistrano会挤压64位

时间:2012-10-01 15:39:42

标签: ruby debian gemfile webistrano

我目前正试图在新安装的debian 64gs上安装Webistrano,但我面临一些我无法解决的问题。

注意:机器是在Xen环境下创建的,我不认为这会影响程序,但是提到它似乎很重要。


步骤:

信息:

  • Ruby版本:ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
  • Rails版本:`Rails 2.3.11
  • 路径修饰符:/usr/lib/ruby/1.8:/var/lib/gems/1.8/bin
  • Rails环境:开发
  • 已创建数据库
  • webistrano的数据库设置,我相信是正确的(user / pass / path_to_sock_file)

所以,这就是我所做的:

我首先安装了'基础知识'这种安装的包装:

# apt-get install build-essential ruby rubygems libmysql-ruby libmysqlclient-dev libdbd-mysql-ruby mysql-server unzip rake

然后我一直在将项目下载并解压缩到/ usr / src中。复制和配置电子邮件/数据库设置的文件后(如https://github.com/peritor/webistrano所示),我继续安装项目所需的所有宝石:

bundle install

此时,命令卡住了,并且一小时都没有做任何事情。

我知道如果Gemfile很复杂会发生这种情况,但对我来说似乎并非如此。 (参见下面的Gemfile)

# cat Gemfile
source "http://rubygems.org"

gem 'bundler', "~>1.0.10"
gem "rails", "2.3.11"
gem "mysql"
gem "erubis"
gem "rake"
gem "syntax", "1.0.0"
gem "capistrano", "2.6.0"
gem "open4", "0.9.3"
gem "exception_notification", "2.3.3.0"

group :test do
  gem "mocha", "0.9.8"
end

所以决定继续我用手安装宝石,一旦完成就给出了:

# gem list *gems of Gemfile*
bundler (1.0.10)
rails (2.3.11)
mysql (2.8.1)
erubis (2.7.0)
rake (0.9.2.2)
syntax (1.0.0)
capistrano (2.6.0)
open4 (0.9.3)
exception_notification (2.3.3.0)
mocha (0.9.8)

所以我相信一切都应该运行而不必运行:bundle install

这就是我最终尝试用rake创建数据库结构的原因:

# rake db:migrate --trace
(in /usr/src/peritor-webistrano-a98ba6b)
rake aborted!
Bundler couldn't find some gems.Did you run `bundle install`?
/usr/src/peritor-webistrano-a98ba6b/config/../config/preinitializer.rb:18
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:28:in `load'
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:28:in `preinitialize'
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:10:in `boot!'
/usr/src/peritor-webistrano-a98ba6b/config/boot.rb:123
/usr/src/peritor-webistrano-a98ba6b/Rakefile:4:in `require'
/usr/src/peritor-webistrano-a98ba6b/Rakefile:4
/usr/lib/ruby/1.8/rake.rb:2383:in `load'
/usr/lib/ruby/1.8/rake.rb:2383:in `raw_load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2017:in `load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:2016:in `load_rakefile'
/usr/lib/ruby/1.8/rake.rb:2000:in `run'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:28

根据rake错误消息,显然有些宝石没有正确安装,这看起来很奇怪,但我猜他无法找到它。

所以我用捆绑工具仔细检查:

# bundle check
Your Gemfile's dependencies could not be satisfied
Install missing gems with `bundle install`
# bundle show
Could not find gem 'mocha (= 0.9.8, runtime)' in any of the gem sources listed in your Gemfile.

我被困在这里,我只是不知道如何继续。 我谷歌周围关于摩卡或宝石文件的问题,但没有找到相关的。

我希望一切都清晰易懂,因为这是我的第一篇文章。

感谢您的回复/提示,如果我能够不断发展,我会尽量让您及时了解!

1 个答案:

答案 0 :(得分:0)

检查以下说明: http://www.gogolek.co.uk/blog/2012/10/web-application-deployment-webistrano-capistrano/

另外我在我的干净debian 6 64位上安装mysql gem有问题,所以我不得不运行

$ apt-get install libmysqlclient-dev ruby-dev 

我最终安装了以下宝石

Using rake (0.8.7) 
Using activesupport (2.3.11) 
Using rack (1.1.6) 
Using actionpack (2.3.11) 
Using actionmailer (2.3.11) 
Using activerecord (2.3.11) 
Using activeresource (2.3.11) 
Using bundler (1.0.10) 
Using highline (1.6.20) 
Using net-ssh (2.7.0) 
Using net-scp (1.1.2) 
Using net-sftp (2.1.2) 
Using net-ssh-gateway (1.2.0) 
Using capistrano (2.6.0) 
Using erubis (2.7.0) 
Using exception_notification (2.3.3.0) 
Using mocha (0.9.8) 
Installing mysql (2.9.1) with native extensions 
Installing open4 (0.9.3) 
Installing rails (2.3.11) 
Installing syntax (1.0.0) 
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.