Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/61.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/20.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 ruby on rail部署问题-您已经激活了rack 1.5.1,但您的Gemfile需要rack 1.4.4。使用bundle exec可以解决这个问题_Ruby On Rails_Ruby_Thin - Fatal编程技术网

Ruby on rails ruby on rail部署问题-您已经激活了rack 1.5.1,但您的Gemfile需要rack 1.4.4。使用bundle exec可以解决这个问题

Ruby on rails ruby on rail部署问题-您已经激活了rack 1.5.1,但您的Gemfile需要rack 1.4.4。使用bundle exec可以解决这个问题,ruby-on-rails,ruby,thin,Ruby On Rails,Ruby,Thin,我尝试使用thin部署rubyonrails应用程序。我犯了这个错误 /usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.0/lib/bundler/runtime.rb:31:in `block in setup': You have already activated rack 1.5.1, but your Gemfile requires rack 1.4.4. Using bundle exec may solve t

我尝试使用thin部署rubyonrails应用程序。我犯了这个错误

/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.0/lib/bundler/runtime.rb:31:in `block in setup': You have already activated rack 1.5.1, but your Gemfile requires rack 1.4.4. Using bundle exec may solve this. (Gem::LoadError)
        from /usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.0/lib/bundler/runtime.rb:17:in `setup'
        from /usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.0/lib/bundler.rb:116:in `setup'
        from /usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.2.0/lib/bundler/setup.rb:7:in `<top (required)>'
        from /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /var/www/rails/mgm/config/boot.rb:6:in `<top (required)>'
        from /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /var/www/rails/mgm/config/application.rb:1:in `<top (required)>'
        from /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /var/www/rails/mgm/config/environment.rb:2:in `<top (required)>'
        from /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /usr/local/rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /var/www/rails/mgm/config.ru:3:in `block in <main>'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/rack-1.5.1/lib/rack/builder.rb:55:in `instance_eval'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/rack-1.5.1/lib/rack/builder.rb:55:in `initialize'
        from /var/www/rails/mgm/config.ru:1:in `new'
        from /var/www/rails/mgm/config.ru:1:in `<main>'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/thin-1.5.0/lib/rack/adapter/loader.rb:33:in `eval'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/thin-1.5.0/lib/rack/adapter/loader.rb:33:in `load'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/thin-1.5.0/lib/rack/adapter/loader.rb:42:in `for'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/thin-1.5.0/lib/thin/controllers/controller.rb:169:in `load_adapter'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/thin-1.5.0/lib/thin/controllers/controller.rb:73:in `start'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/thin-1.5.0/lib/thin/runner.rb:187:in `run_command'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/thin-1.5.0/lib/thin/runner.rb:152:in `run!'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/thin-1.5.0/bin/thin:6:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/bin/thin:19:in `load'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/bin/thin:19:in `<main>'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/bin/ruby_noexec_wrapper:14:in `eval'
        from /usr/local/rvm/gems/ruby-1.9.3-p125/bin/ruby_noexec_wrapper:14:in `<main>'
然后跑

bundle update rack
我犯了以下错误

Bundler could not find compatible versions for gem "rack":
  In Gemfile:
    rails (= 3.2.8) ruby depends on
      rack (~> 1.4.0) ruby

    rack (1.5.1)
我跑

返回

bundler: exec needs a command to run

尝试使用卸载机架

gem uninstall rack 

bundle install

可以使用此命令执行以下操作:

bundle update

这里有哪个版本的机架:/usr/local/rvm/gems/ruby-1.9.3-p125@global/gems/(如果您创建了应用程序的gems文件,则在应用程序的gems文件中,您应该这样做)?机架1.5.1可能已安装,但您的Gemfile需要1.4.4。。。您是否尝试过将GEM文件中的语句从1.4.4更改为1.5.1?@Sparda在主屏幕上进行更新,并尝试使用
bundle exec
?@icn确定,因此您的Rails版本依赖于rack 1.4.4,所以将1.5.1替换为
~>1.4.0
,像以前一样尝试更新您的GEM。如果不起作用,请尝试使用
gem uninstall rack
卸载rack,然后再次运行bundle安装。@Sparda非常感谢:)“gem uninstall rack”已解决问题如果您只在一个环境中工作,并且只需要安装一个版本的rack,这一切都很好,但是
bundle exec
(如错误消息所示)在这种情况下,有什么具体的解决办法。人们应该真正使用
bundle exec
,或者如果这是不可取的/不充分的,可以使用其他类型的gem集管理(例如rvm gemests)来确保项目在运行的任何地方加载相同的gems(例如dev vs prod)。通过gemests管理gems是我在对icn问题的第一次评论中建议的;)
bundle install
bundle update