Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Capistrano部署后的rvm和GEM_路径;can';t访问“;轨道c";_Ruby On Rails_Rubygems_Ruby On Rails 3.1_Rvm - Fatal编程技术网

Ruby on rails Capistrano部署后的rvm和GEM_路径;can';t访问“;轨道c";

Ruby on rails Capistrano部署后的rvm和GEM_路径;can';t访问“;轨道c";,ruby-on-rails,rubygems,ruby-on-rails-3.1,rvm,Ruby On Rails,Rubygems,Ruby On Rails 3.1,Rvm,我正在使用Capistrano,使用rvm和ruby 1.9.2-p290将其部署到Ubuntu11.10主机上。这似乎运作良好 乘客/nginx设置正确,运行良好。问题是我现在在几个地方都有宝石 创业板环境给了我: GEM PATHS: "/usr/local/rvm/gems/ruby-1.9.2-p290:/usr/local/rvm/gems/ruby-1.9.2-p290@global 但是rails安装在$appname/shared/bundle/ruby/1.9.1/g

我正在使用Capistrano,使用rvm和ruby 1.9.2-p290将其部署到Ubuntu11.10主机上。这似乎运作良好

乘客/nginx设置正确,运行良好。问题是我现在在几个地方都有宝石

创业板环境给了我:

GEM PATHS:     "/usr/local/rvm/gems/ruby-1.9.2-p290:/usr/local/rvm/gems/ruby-1.9.2-p290@global
但是rails安装在$appname/shared/bundle/ruby/1.9.1/gems中。我想运行rails c,但不行。我该如何解决这个问题

编辑#1 如果您使用以下命令,则此命令位于Linode

bundle install --path <path>
您还可以使用:

bundle install --path <path> --binstubs
或在rvm中使用打捆机挂钩:

chmode +x $rvm_path/hooks/after_cd_bundler
当您执行以下操作时,将更新路径:

cd $appname

我最初是在跑步:

bundle exec rails c
但是,遇到权限问题,因此您必须提供环境:

RAILS_ENV=production bundle exec rails c
或者更好:

bundle exec rails c production
RAILS_ENV=production bundle exec rails c
bundle exec rails c production