1

这是我的问题的摘要:我建立了一个新服务器,我安装了 Rubinius 和其他一些东西,如此处所述。我部署了。该站点已准备好进行多次部署。在某个时候,我遇到了问题并开始尝试随机解决方案。我在使用 bundler 时遇到了问题,无法通过它。沮丧,我建立了一个全新的服务器。我仍然有这个问题。这表明我的代码或我的 capistrano 脚本存在问题......但我在开发中没有任何捆绑程序问题,我回到了之前工作的 capistrano 脚本,没有任何乐趣。所以我很困惑。任何想法将不胜感激。

Xena 是第二台机器。这是我在部署后得到的:

production@xena:~/lexicon/current$ ruby -v
rubinius 2.4.1 (2.1.0 b332f133 2014-12-04 3.4 JI) [x86_64-linux-gnu]

Capistrano 运行了这个命令,但我再次执行它只是为了显示结果:

production@xena:~/lexicon/current$ /usr/local/bin/chruby-exec rbx-2.4.1 -- bundle install --binstubs /home/production/lexicon/shared/bin --path /home/production/lexicon/shared/bundle --without development test --deployment
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.2
Using minitest 5.5.1
Using thread_safe 0.3.4
Using tzinfo 1.2.2
Using activesupport 4.2.0
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile 0.6.2
Using nokogiri 1.6.5
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.5
Using loofah 2.0.1
Using rails-html-sanitizer 1.0.1
Using actionview 4.2.0
Using rack 1.6.0
Using rack-test 0.6.3
Using actionpack 4.2.0
Using globalid 0.3.0
Using activejob 4.2.0
Using mime-types 2.4.3
Using mail 2.6.3
Using actionmailer 4.2.0
Using activemodel 4.2.0
Using arel 6.0.0
Using activerecord 4.2.0
Using bcrypt 3.1.9
Using climate_control 0.0.3
Using cocaine 0.5.5
Using commonjs 0.2.7
Using execjs 2.2.2
Using tilt 1.4.1
Using haml 4.0.6
Using hike 1.2.3
Using thor 0.19.1
Using railties 4.2.0
Using jquery-rails 4.0.3
Using jquery-ui-rails 5.0.3
Using less 2.6.0
Using less-rails 2.6.0
Using libv8 3.16.14.7
Using multi_json 1.10.1
Using mysql2 0.3.17
Using net-ssh 2.7.0
Using paperclip 4.2.1
Using polyamorous 1.1.0
Using psych 2.0.9
Using puma 2.10.2
Using bundler 1.7.11
Using sprockets 2.12.3
Using sprockets-rails 2.2.2
Using rails 4.2.0
  ing ransack 1.6.1
▽sing redcarpet 3.2.2
Using ref 1.0.5
Using rollbar 1.4.0
Using simple_form 3.1.0
Using therubyracer 0.12.1
Using twitter-bootstrap-rails 3.2.1 from https://github.com/seyhunak/twitter-bootstrap-rails.git (at master)
Using uglifier 2.7.0
Using valuable 0.9.9
Using warden 1.2.3
Using will_paginate 3.0.7
Using will_paginate-bootstrap 1.0.1
Your bundle is complete!
Gems in the groups development and test were not installed.
It was installed into /home/production/lexicon/shared/bundle

然后我尝试运行rails:

production@xena:~/lexicon/current$ bin/rails c
Could not find i18n-0.7.0 in any of the sources
Run `bundle install` to install missing gems.

也许通过捆绑器?:

production@xena:~/lexicon/current$ bundle exec rails c
bundler: command not found: rails
Install missing gem executables with `bundle install`

我的捆绑器配置。我知道 rubinius 和 psych 有一些奇怪的问题,但这似乎没问题:

production@xena:~/lexicon/current$ vim .bundle/config
--- !ruby/hash-with-ivars
elements:
  BUNDLE_FROZEN: '1'
  BUNDLE_PATH: "/home/production/lexicon/shared/bundle"
  BUNDLE_BIN: "/home/production/lexicon/shared/bin"
  BUNDLE_WITHOUT: development:test
  BUNDLE_DISABLE_SHARED_GEMS: '1'
ivars:
  :@capacity: 16
  :@max_entries: 12
  :@entries: !ruby/object:Rubinius::Tuple {}
  :@state: &1 !ruby/object:Hash::State
    tail: &5 !ruby/object:Hash::Bucket
      link:
      state: *1
      value: '1'
      previous: &2 !ruby/object:Hash::Bucket
        link:
        state: *1

好吧,让我们确保那里有一些宝石:

production@xena:~/lexicon/current$ ls /home/production/lexicon/shared/bundle/rbx/2.1/bin/
erubis  lessc     puma     rackup  rake       sprockets  tilt
haml    nokogiri  pumactl  rails   redcarpet  thor

这似乎是对的……

production@xena:~/lexicon/current$ ls /home/production/lexicon/shared/bundle/rbx/2.1/gems

actionmailer-4.2.0            net-ssh-2.7.0
actionpack-4.2.0              nokogiri-1.6.5
actionview-4.2.0              paperclip-4.2.1
activejob-4.2.0               polyamorous-1.1.0
activemodel-4.2.0             psych-2.0.9
activerecord-4.2.0            puma-2.10.2
activesupport-4.2.0           rack-1.6.0
arel-6.0.0                    rack-test-0.6.3
bcrypt-3.1.9                  rails-4.2.0
builder-3.2.2                 rails-deprecated_sanitizer-1.0.3
climate_control-0.0.3         rails-dom-testing-1.0.5
cocaine-0.5.5                 rails-html-sanitizer-1.0.1
commonjs-0.2.7                railties-4.2.0
erubis-2.7.0                  rake-10.4.2
execjs-2.2.2                  ransack-1.6.1
globalid-0.3.0                redcarpet-3.2.2
haml-4.0.6                    ref-1.0.5
hike-1.2.3                    rollbar-1.4.0
i18n-0.7.0                    simple_form-3.1.0
jquery-rails-4.0.3            sprockets-2.12.3
jquery-ui-rails-5.0.3         sprockets-rails-2.2.2
json-1.8.2                    therubyracer-0.12.1
less-2.6.0                    thor-0.19.1
less-rails-2.6.0              thread_safe-0.3.4
libv8-3.16.14.7-x86_64-linux  tilt-1.4.1
loofah-2.0.1                  tzinfo-1.2.2
mail-2.6.3                    uglifier-2.7.0
mime-types-2.4.3              valuable-0.9.9
mini_portile-0.6.2            warden-1.2.3
minitest-5.5.1                will_paginate-3.0.7
multi_json-1.10.1             will_paginate-bootstrap-1.0.1
mysql2-0.3.17

任何帮助找出为什么捆绑器找不到它刚刚放置的文件将不胜感激。

4

2 回答 2

2

在 #rubinius 上的 brixen 和 yorickpeterse 的帮助下,我们发现这种混乱的根本原因是 2.0.8 以上的 psych。

#with rbx 2.4.1 and psych 2.0.8
rbx-2.4.1 :003 > YAML.dump({fu: 'bar'})
=> "---\n:fu: bar\n"

但是当你更新版本时问题就来了:

rbx-2.4.1 :005 > YAML.dump({fu: 'bar'})
=> "--- !ruby/hash-with-ivars\nelements:\n  :fu: bar\nivars:\n  :@entries: !ruby/object:Rubinius::Tuple {}\n  :@capacity: 16\n  :@size: 1\n  :@max_entries: 12\n  :@state: &1 !ruby/object:Hash::State\n    compare_by_identity: false\n    head: &2 !ruby/object:Hash::Bucket\n      key_hash: 2112643688174279348\n      value: bar\n      link: \n      state: *1\n      key: :fu\n    tail: *2\n  :@mask: 15\n"

Capistrano 在创建.bundle/config. Capistrano 似乎无法读取其配置文件的“创意”版本,因此它恢复为默认值。

一旦我在生产机器上安装了 psych 2.0.6 并更正了我的 gemfile,我就能够成功部署。

参考

于 2015-01-15T17:11:38.937 回答
1

添加到您的 Gemfile:gem 'i18n', '~> 0.7.0'

然后运行bundle update i18n

于 2015-01-14T19:08:14.293 回答