UbuntuのRails3.2 + Passenter3 + Apache2 + RVM
-
12-12-2019 - |
質問
私は乗客+ RVM + Apache + Railsが作業するのに苦労しています。ページを開くときは、乗客から次のエラーメッセージが表示されます。
Ruby (Rack) application could not be started These are the possible causes: There may be a syntax error in the application's code. Please check for such errors and fix them. A required library may not installed. Please install all libraries that this application requires. The application may not be properly configured. Please check whether all configuration files are written correctly, fix any incorrect configurations, and restart this application. A service that the application relies on (such as the database server or the Ferret search engine server) may not have been started. Please start that service. Further information about the error may have been written to the application's log file. Please check it in order to analyse the problem. Error message: uninitialized constant Capistrano Exception class: NameError Application root: /var/www/www.pixtur.org/rails/current Backtrace: File Line Location 0 /var/www/www.------------.----/rails/shared/bundle/ruby/1.9.1/gems/rvm-capistrano-1.2.0/lib/rvm/capistrano.rb 3 in `' 1 /home/pixtur/.rvm/gems/ruby-1.9.2-p180@global/gems/bundler-1.1.3/lib/bundler/runtime.rb 74 in `require' 2 /home/pixtur/.rvm/gems/ruby-1.9.2-p180@global/gems/bundler-1.1.3/lib/bundler/runtime.rb 74 in `rescue in block in require' 3 /home/pixtur/.rvm/gems/ruby-1.9.2-p180@global/gems/bundler-1.1.3/lib/bundler/runtime.rb 62 in `block in require' 4 /home/pixtur/.rvm/gems/ruby-1.9.2-p180@global/gems/bundler-1.1.3/lib/bundler/runtime.rb 55 in `each' 5 /home/pixtur/.rvm/gems/ruby-1.9.2-p180@global/gems/bundler-1.1.3/lib/bundler/runtime.rb 55 in `require' 6 /home/pixtur/.rvm/gems/ruby-1.9.2-p180@global/gems/bundler-1.1.3/lib/bundler.rb 119 in `require'.
私は理解していない、このエラーメッセージが私に言おうとしていることです。RVMが1.9.2-P180にマップする必要があるRuby-1.9.1を参照するように思われるのは混乱しています。
私たちのより多くの助け、ポインタ、または次のステップは大歓迎です。
$ gem_path
リモートマシンにSSHが付いている: $ ECHO $ GEM_PATH. /home/pixtur/.rvm/gems/ruby-1.9.2-p180@pixtur-org:/home/pixtur/.rvm/gems/ruby-1.9.2-p180@global
現在のdeploy.rb
require "bundler/capistrano"
set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"") # Read from local system
# Load RVM's capistrano plugin:
require "rvm/capistrano"
set :user, 'pixtur'
set :domain, 'www.--------------.com'
set :applicationdir, "/var/www/www.somedomain.com/rails"
set :scm, 'git'
set :repository, "gitosis@------------------.git"
#set :git_enable_submodules, 1 # if you have vendored rails
set :branch, 'master'
set :git_shallow_clone, 1
set :scm_verbose, true
set :deploy_to, applicationdir
set :use_sudo, false
#set :scm, :git
role :app, domain
role :web, domain
role :db, domain, :primary => true
# additional settings
default_run_options[:pty] = true # Forgo errors when deploying from windows
namespace :deploy do
task :start, :roles => :app do
run "touch #{current_release}/tmp/restart.txt"
end
task :stop, :roles => :app do
end
task :restart, :roles => :app do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
desc "Install bundler"
task :bundle_install do
begin
run "bundle install"
rescue
gem_install_bundler
end
end
end
.
.bundle / config
---
BUNDLE_FROZEN: '1'
BUNDLE_PATH: /var/www/www.----------.---/rails/shared/bundle
BUNDLE_DISABLE_SHARED_GEMS: '1'
BUNDLE_WITHOUT: development:test
.
ρmrc
if [[ -s "/Users/pixtur/.rvm/environments/ruby-1.9.2-p180@pixtur-org" ]] ; then
. "/Users/pixtur/.rvm/environments/ruby-1.9.2-p180@pixtur-org"
else
rvm --create use "ruby-1.9.2-p180@pixtur-org"
. 解決
問題はあなたの宝石から来ています、
1)gem 'rvm-capistrano'
を開発グループに移動する必要があります - このように、shared/bundle
にインストールされません。
2)gem 'rvm-capistrano', :lib => 'rvm/capistrano'
を使用している機会は、LIB部分は必要ありません、実際にはそれが物事を壊す可能性があります。
再度展開する前に、サーバー上のshared/bundle
をクリアする必要があります。
所属していません StackOverflow