首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么不将安装栏杆3.2.3捆绑在我的服务器上?

为什么不将安装栏杆3.2.3捆绑在我的服务器上?
EN

Stack Overflow用户
提问于 2012-04-12 17:54:34
回答 1查看 573关注 0票数 1

Rails 3.2.2在我的开发环境和服务器上都运行良好。

我试图通过更改来升级到3.2.3:

代码语言:javascript
复制
gem 'rails', '3.2.2'

代码语言:javascript
复制
gem 'rails', '3.2.3'

然后跑:

代码语言:javascript
复制
bundle update
bundle

在我试图部署到我的服务器之前,一切都进行得很顺利。在部署过程中,我收到以下消息:

代码语言:javascript
复制
An error occured while installing railties (3.2.3), and Bundler cannot continue.
Make sure that `gem install railties -v '3.2.3'` succeeds before bundling.

我已经登录到服务器,并运行了gem安装栏杆-v '3.2.3‘命令,它的工作没有问题。但是部署总是以同样的方式失败。

我尝试删除缓存目录,如这里所示,但我不确定是否正确。我在服务器和我的开发环境上使用rvm。

有人能帮我指出这个方向吗?

这是我的deploy.rb文件:

代码语言:javascript
复制
require "bundler/capistrano"

$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano"                  # Load RVM's capistrano plugin.

set :application, "teamsite"
set :repository,  "git@github.com:user/teamsite.git"
set :deploy_to, "/home/website.com/rails/application/"
set :user, "website.com"
set :scm, :git
set :use_sudo, false
default_run_options[:pty] = true
set :branch, "master"
set :scm_verbose, true
set :deploy_via, :remote_cache
ssh_options[:forward_agent] = true

task :staging do
  role :web, "staging.website.com"
  role :app, "staging.website.com"
  role :db,  "staging.website.com", :primary => true
end

namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end

  namespace :assets do
    task :precompile, :roles => :web, :except => { :no_release => true } do
      from = source.next_revision(current_revision)
      if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
        run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
      else
        logger.info "Skipping asset pre-compilation because there were no asset changes"
      end
    end
  end
end

namespace :customs  do
  task :create_symlink, :roles => :app do
    run <<-CMD
      ln -nfs #{shared_path}/files #{release_path}/files
    CMD

    run <<-CMD
      ln -nfs #{shared_path}/drawings #{release_path}/drawings
    CMD

    run <<-CMD
      ln -nfs #{shared_path}/photos #{release_path}/photos
    CMD
  end
end

after "deploy:create_symlink","customs:create_symlink"
after "deploy", "deploy:cleanup"

更新

我最终能够通过部署到另一个用户来修复这个问题。但问题仍然存在:我如何为老用户清除gem缓存?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-04-15 22:23:24

你可以用

代码语言:javascript
复制
gem pristine --all --no-extensions

从零开始重新安装所有的宝石。如果你在主机上使用乘客,你需要找出创业板缓存目录的真正位置。查看.bashrc for GEM_PATH值,我在Dreamhost上的值是:

代码语言:javascript
复制
export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"

或者,如果您在服务器上使用RVM,则该路径很可能与rvm使用的当前版本相同。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10129044

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档