Ruby on rails 为什么赢了';t bundle是否在我的服务器上安装railties 3.2.3?
Rails 3.2.2在我的开发环境和服务器上都运行良好 我正在尝试通过更改以下内容升级到3.2.3:Ruby on rails 为什么赢了';t bundle是否在我的服务器上安装railties 3.2.3?,ruby-on-rails,ruby-on-rails-3,rvm,bundler,ruby-on-rails-3.2,Ruby On Rails,Ruby On Rails 3,Rvm,Bundler,Ruby On Rails 3.2,Rails 3.2.2在我的开发环境和服务器上都运行良好 我正在尝试通过更改以下内容升级到3.2.3: gem 'rails', '3.2.2' 到 然后运行: bundle update bundle 在我尝试部署到服务器之前,一切都进展顺利。在部署期间,我收到以下消息: An error occured while installing railties (3.2.3), and Bundler cannot continue. Make sure that `gem install r
gem 'rails', '3.2.2'
到
然后运行:
bundle update
bundle
在我尝试部署到服务器之前,一切都进展顺利。在部署期间,我收到以下消息:
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 install railties-v'3.2.3'命令,它可以正常工作。但部署总是以同样的方式失败
我试图删除缓存目录,如图所示,但我不确定是否正确。我在服务器和开发环境上使用rvm
有人能帮我指出这方面的方向吗
这是我的deploy.rb文件:
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"
需要“bundler/capistrano”
$:.unshift(File.expand_path('./lib',ENV['rvm_path']))#将rvm的lib目录添加到加载路径。
需要“rvm/capistrano”#加载rvm的capistrano插件。
集合:应用程序,“团队站点”
集合:存储库,“git@github.com:user/teamsite.git“
设置:将部署到“/home/website.com/rails/application/”
设置:用户“website.com”
set:scm,:git
设置:使用_sudo,false
默认运行选项[:pty]=真
集合:分支,“主”
set:scm\u verbose,true
set:deploy\u via,:remote\u缓存
ssh_选项[:转发_代理]=真
任务:登台做什么
角色:网站,“staging.website.com”
角色:应用程序“staging.website.com”
角色:db,“staging.website.com”,:primary=>true
结束
名称空间:deploydo
任务:开始做;结束
任务:停止做;结束
任务:重新启动,:角色=>:app,:except=>{:no\u release=>true}do
运行“#{try#sudo}touch#{File.join(当前路径,'tmp','restart.txt')”
结束
名称空间:资产做什么
任务:预编译,:角色=>:web,:except=>{:no\u release=>true}do
from=来源。下一个修订版(当前修订版)
如果捕获(“cd{最新版本}&&{source.local.log(from)}供应商/assets/app/assets/| wc-l”)。到_i>0
运行%Q{cd}{lake}RAILS{u ENV={RAILS{u ENV}{asset}ENV}asset:precompile}
其他的
logger.info“跳过资产预编译,因为没有资产更改”
结束
结束
结束
结束
名称空间:海关
任务:创建符号链接,:角色=>:应用程序执行
运行您可以使用
gem pristine --all --no-extensions
从头开始重新安装所有gems。如果您在主机上使用passenger,则需要找出gem缓存目录的实际位置。查看.bashrc中的GEM_路径值,Dreamhost上的我的是:
export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"
或者,如果您在服务器上使用RVM,则该路径可能与RVM当前使用的版本相同
export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"