【问题标题】:Installing Webistrano on Debian squeeze 64bits在 Debian Squeeze 64 位上安装 Webistrano
【发布时间】:2012-10-01 15:39:42
【问题描述】:

我目前正在尝试在新安装的 64 位 debian 挤压机上安装 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 建议的那样),我继续安装项目所需的所有 gem:

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

所以决定继续,我手动安装了 gems,完成后给出:

# 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 错误信息,显然有些 gem 没有正确安装,这看起来很奇怪,但我猜他找不到。

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

# 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.

我被困在这里,我只是不知道如何继续。 我在谷歌上搜索了 mocha 或 gemfile 问题,但没有发现太多相关性。

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

感谢您的任何回复/提示,如果我设法发展,我会尽力让您了解最新情况!

【问题讨论】:

    标签: ruby debian gemfile webistrano


    【解决方案1】:

    查看以下说明: 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 
    

    我最终安装了以下 gems

    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.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-07
      • 2011-12-08
      • 2020-10-21
      • 1970-01-01
      相关资源
      最近更新 更多