Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.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 捆绑机可以';运行脚本/控制台时找不到torquebox web gem_Ruby On Rails_Bundler_Torquebox - Fatal编程技术网

Ruby on rails 捆绑机可以';运行脚本/控制台时找不到torquebox web gem

Ruby on rails 捆绑机可以';运行脚本/控制台时找不到torquebox web gem,ruby-on-rails,bundler,torquebox,Ruby On Rails,Bundler,Torquebox,我正在尝试让一个Rails 2.3应用程序在Linux(Redhat)服务器上使用Bundler/Torquebox。该应用程序通过JBoss正常工作,但不允许我启动控制台。我在运行jruby脚本/控制台时遇到以下错误: Bundler could not find compatible versions for gem "torquebox-web": In snapshot (Gemfile.lock): torquebox-web (2.3.1) In Gemfile:

我正在尝试让一个Rails 2.3应用程序在Linux(Redhat)服务器上使用Bundler/Torquebox。该应用程序通过JBoss正常工作,但不允许我启动控制台。我在运行jruby脚本/控制台时遇到以下错误:

Bundler could not find compatible versions for gem "torquebox-web":
  In snapshot (Gemfile.lock):
    torquebox-web (2.3.1)

  In Gemfile:
    torquebox (= 2.3.1) ruby depends on
      torquebox-web (= 2.3.1) ruby

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
当我运行
jruby-S bundle update
时,它告诉我它正在使用所有正确版本的gems,但控制台仍然无法工作


我正在运行Rails 2.3.18、Torquebox 2.3.1和Bundler 1.3.5。另外值得注意的是,这在我的Windows开发机器和任何Rails 3.2应用程序上都能正常工作(使用
jruby脚本/Rails控制台
)。你知道这是什么原因吗?

jruby脚本/控制台
显然需要jruby在
路径
中才能正常工作。如果未将其添加到
路径
,则该命令将拾取系统Ruby(或
路径
中的任何其他内容)

要解决此问题,我可以运行以下命令:

export PATH=$JRUBY_HOME/bin:$PATH
jruby script/console
正如Simon指出的,在调用
jruby
之前使用
bundle exec
也是一个好主意:

bundle exec jruby script/console

如果您不想每次都运行
export
命令,请在设置所有其他环境变量的位置添加该环境变量。

您是否尝试过
bundle exec jruby script/rails console
@Simon好主意;我没有想到这一点,但不幸的是,这也有同样的效果。