LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 490|回复: 6

求教:升级OBS出现问题

[复制链接]
发表于 2012-2-14 15:50:04 | 显示全部楼层 |阅读模式
系统: opensuse 11.4
我之前在自己的的机器上搭建了一个OBS,使用的是OBS官方正式发布的2.1版本。今天突然心血来潮,想升级到2.2版本,(在官方的unstable源中),结果就悲剧了。。。
升级过程如下:

1。关闭所有的OBS服务
2。移掉之前搭建OBS时添加的repo,增加新repo:
     # zypper ar http://download.opensuse.org/rep ... table/openSUSE_11.4 tools
3. 然后输入:
    # zypper up obs-server obs-api obs-source_service build
    报错说找不到json,于是到software.opensuse.org上搜索并下载安装了
    rubygem-json-1.4.6
    因为还其他类似的问题,一并把安装和更新的包列出:
    rubygem-rails_xss
    rubygem-rdoc-2.5.11
    perl-BSSolv-0.18.0
    然后再次执行上面的那个zypper命令。OK!
4. 修改配置文件
    因为之前运行过,所以更新的时候,一些配置文件都没有被覆盖,为了避免更新后的配置文件和原先的有差别,就打开新的配置文件,照着旧的修改,具体有:
    /srv/www/obs/api/config/database.yml
    /srv/www/obs/api/config/options.yml
    /srv/www/obs/api/config/environments/production.rb
    /srv/www/obs/webui/config/database.yml
5.迁移数据库
   按照README.setup的指令,迁移:
   # cd /srv/www/obs/api
   # RAILS_ENV="production" rake db:migrate
   # chown -R wwwrun.www log tmp
   # cd /srv/www/obs/api
   # RAILS_ENV="production" rake db:migrate
   # chown -R wwwrun.www log tmp
  
6. 更新webservice
   因为OBS2.1版本默认使用的webservice是lighttpd, 而2.2版本改成了apache. 所以继续按照README进行
   # zypper in apache2 rubygem-passenger-apacher apache2-mod_xforward
7. 修改配置
    按照README.setup修改apache配置
    /etc/sysconfig/apache2

8. 重启OBS服务:于是乎,问题出来了:
在启动obsapidelayed服务时:报了一堆错:
# rcobsapidelayed  start
Starting OBS api delayed job handler NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:100.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:124.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:124.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:124.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:124.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:124.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:124.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:124.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:104.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:104.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:104.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:119.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#search called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:119.
** Erubis 2.6.6
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/gem_dependency.rb:78.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:123.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/vendor_gem_source_index.rb:124.
Missing these required gems:
  exception_notification  >= 0

You're running:
  ruby 1.8.7.357 at /usr/bin/ruby
  rubygems 1.8.15 at /usr/lib/ruby/gems/1.8, /root/.gem/ruby/1.8

Run `rake gems:install` to install the missing gems.
startproc:  exit status of parent of /srv/www/obs/api/script/delayed_job.api: 1
                                                                                                                                   failed

但是这个gem是有的:
# gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.2.1, 2.3.14)
actionpack (3.2.1, 2.3.14)
activemodel (3.2.1)
activerecord (3.2.1, 2.3.14)
activeresource (3.2.1, 2.3.14)
activesupport (3.2.1, 2.3.14)
arel (3.0.0)
builder (3.0.0, 2.1.2)
bundler (1.0.22)
ci_reporter (1.7.0, 1.6.5)
daemon_controller (1.0.0, 0.2.5)
daemons (1.1.8, 1.0.10)
delayed_job (3.0.1, 1.8.4)
erubis (2.7.0, 2.6.6)
exception_notification (2.5.2, 2.3.3.0, 1.0.20090728)
fastthread (1.0.7)
file-tail (1.0.8, 1.0.5)
gruff (0.3.6)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.1)
json (1.4.6)
libxml-ruby (1.1.3)
mail (2.4.1)
mime-types (1.17.2)
multi_json (1.0.4)
nokogiri (1.4.4)
passenger (3.0.11, 3.0.2)
polyglot (0.3.3)
rack (1.4.1, 1.1.2)
rack-cache (1.1)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.1, 2.3.14)
rails_xss (0.1.3.1)
railties (3.2.1)
rake (0.9.2.2, 0.8.7)
rdoc (3.12, 2.5.11)
rmagick (2.13.1)
sprockets (2.1.2)
spruz (0.2.13, 0.2.2)
sqlite3-ruby (1.3.0)
thor (0.14.6)
tilt (1.3.3)
tins (0.3.8)
treetop (1.4.10)
tzinfo (0.3.31)

因为对ruby不熟,go了半天也没有个所以然。所以,有人能帮忙看看么~~~~~~~Orz

==============本来想在官方论坛上发,结果,半天都发布出去,索性现这里问吧。。
多谢了~~
 楼主| 发表于 2012-2-14 17:39:31 | 显示全部楼层
从github上找到了解决rubygem报错的问题
https://github.com/peritor/webistrano/issues/34

执行
# gem update --system 1.6.2

但是,还有错:
# rcobsapidelayed start
Starting OBS api delayed job handler ** Erubis 2.7.0
Missing these required gems:
  delayed_job  >= 0
  exception_notification  >= 0

You're running:
  ruby 1.8.7.357 at /usr/bin/ruby
  rubygems 1.6.2 at /root/.gem/ruby/1.8, /usr/lib/ruby/gems/1.8

Run `rake gems:install` to install the missing gems.
startproc:  exit status of parent of /srv/www/obs/api/script/delayed_job.api: 1
                                                                                                                                   failed
You have new mail in /var/spool/mail/root
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-2-14 18:03:11 | 显示全部楼层
移除掉多余的版本后,
#gem uninstall exception_notification
选2.3.3.0
#gem uninstall delayed_job
选3.0.1

不报错了,但是还是fail:
# /etc/init.d/obsapidelayed  start
Starting OBS api delayed job handler ** Erubis 2.7.0
                                                                                                                                   failed
回复 支持 反对

使用道具 举报

发表于 2012-2-14 21:23:51 | 显示全部楼层
回滚到稳定版吧,这可能是唯一的解决办法。没安装过OBS服务器,帮不上忙。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-2-15 11:13:08 | 显示全部楼层
回滚也好难,因为升了一大堆ruby。。。。。。
实在不想阿。。
回复 支持 反对

使用道具 举报

发表于 2012-2-15 13:15:20 | 显示全部楼层
运行一次sudo zypper dup试试,但是系统一起挂了就别怪我了,别人都写明了是Unstable。这些东西最好拿到虚拟机里面试,没事别安装到真实系统里面。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-2-15 15:23:47 | 显示全部楼层
谢谢!

系统我还是要用的,目前不能挂,所以再想别的办法吧。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表