问题描述
我试图启动一个Amazon EC2实例如下 Railscast#347的指令橡胶和Amazon EC2 。
I am trying to launch an Amazon EC2 instance following the instructions of Railscast #347 Rubber and Amazon EC2.
Rails项目的配置如下。该 .ruby版
文件:
The Rails project is configured as follows. The .ruby-version
file:
ruby-1.9.3
下面是的Gemfile
:
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', '~> 3.2.13'
gem 'rb-readline', '~> 0.5.0'
gem 'counter_culture', '~> 0.1.12'
gem 'jquery-rails', '~> 3.0.2'
gem 'therubyracer', '~> 0.11.4', require: 'v8'
gem 'attribute_normalizer', '~> 1.1.0'
group :assets do
gem 'sass-rails', '~> 3.2.5'
gem 'coffee-rails', '~> 3.2.2'
gem 'uglifier', '~> 2.1.1'
end
group :development do
gem 'debugger', '~> 1.6.0'
end
group :development, :test do
gem 'sqlite3', '~> 1.3.7'
end
group :production do
gem 'pg', '~> 0.15.1'
end
gem 'rubber', '~> 2.5.2'
gem 'open4'
gem 'gelf'
gem 'graylog2_exceptions', :git => 'git://github.com/wr0ngway/graylog2_exceptions.git'
gem 'graylog2-resque'
我运行下面的橡胶命令:
$ rubber vulcanize complete_passenger_postgresql
除了其他文件的橡胶ruby.yml
产生如下(注释去掉):
Besides other files the rubber-ruby.yml
is generated as follows (comments removed):
# config/rubber/rubber-ruby.yml
packages: [build-essential, git-core, subversion, curl, autoconf, bison, ruby, zlib1g-dev, libssl-dev, libreadline6-dev, libxml2-dev, libyaml-dev]
ruby_build_version: 20130501
ruby_version: 1.9.3
ruby_path: "/usr/local/rubies/#{ruby_version}"
与 nirvdrum 的在IRC聊天后,我已经修改 RUBY_VERSION:1.9.3
到 RUBY_VERSION:1.9.3 -p448
,并给它一个尝试。同样的错误,虽然。
After chatting with nirvdrum on IRC I already change the ruby_version: 1.9.3
to ruby_version: 1.9.3-p448
and gave it a try. Same error though.
我粘在教程中,只配置了强制设置:
I sticked to the tutorial and only configured the mandatory settings:
# config/rubber/rubber.yml
app_name: ...
domain: ...
access_key: ...
secret_access_key: ...
account: ...
key_name: ...
继教程中,我测试设置运行:
Following the tutorial I test the setup running:
$ cap rubber:create_staging
该脚本的,而安装并重新启动实例,但同时它停止后运行:
The script runs for a while installing and restarting instances but after a while it stops:
...
** [out :: production.foobar.com] Identified as a _site plugin, moving to _site structure ...
** [out :: production.foobar.com] Installed head
command finished in 5005ms
* 2013-07-11 01:02:20 executing `rubber:graylog:server:install'
servers: ["production.foobar.com"]
** sftp upload #<StringIO:0x007f2d89221718> -> /tmp/install_graylog_server
[production.foobar.com] /tmp/install_graylog_server
[production.foobar.com] done
* sftp upload complete
* executing "sudo -p 'sudo password: ' bash -l /tmp/install_graylog_server"
servers: ["production.foobar.com"]
[production.foobar.com] executing command
command finished in 2320ms
* 2013-07-11 01:02:23 executing `rubber:graylog:web:install'
servers: ["production.foobar.com"]
** sftp upload #<StringIO:0x007f2d817c2a58> -> /tmp/install_graylog_web
[production.foobar.com] /tmp/install_graylog_web
[production.foobar.com] done
* sftp upload complete
* executing "sudo -p 'sudo password: ' bash -l /tmp/install_graylog_web"
servers: ["production.foobar.com"]
[production.foobar.com] executing command
command finished in 945ms
* 2013-07-11 01:02:24 executing `rubber:apache:install'
servers: ["production.foobar.com"]
** sftp upload #<StringIO:0x007f2d81911800> -> /tmp/install_apache
[production.foobar.com] /tmp/install_apache
[production.foobar.com] done
* sftp upload complete
* executing "sudo -p 'sudo password: ' bash -l /tmp/install_apache"
servers: ["production.foobar.com"]
[production.foobar.com] executing command
** [out :: production.foobar.com] Site default disabled.
** [out :: production.foobar.com] To activate the new configuration, you need to run:
** [out :: production.foobar.com] service apache2 reload
command finished in 636ms
* 2013-07-11 01:02:25 executing `rubber:setup_volumes'
* 2013-07-11 01:02:25 executing `rubber:setup_gem_sources'
triggering before callbacks for `rubber:setup_gem_sources'
* 2013-07-11 01:02:25 executing `rubber:base:install_ruby_build'
servers: ["production.foobar.com"]
** sftp upload #<StringIO:0x007f2d81a7f750> -> /tmp/install_ruby_build
[production.foobar.com] /tmp/install_ruby_build
[production.foobar.com] done
* sftp upload complete
* executing "sudo -p 'sudo password: ' bash -l /tmp/install_ruby_build"
servers: ["production.foobar.com"]
[production.foobar.com] executing command
** [out :: production.foobar.com] Installing ruby-build v20130501
** [out :: production.foobar.com] Installed ruby-build at /usr/local
command finished in 1475ms
triggering after callbacks for `rubber:base:install_ruby_build'
* 2013-07-11 01:02:27 executing `rubber:base:install_ruby'
servers: ["production.foobar.com"]
** sftp upload #<StringIO:0x007f2d81aca638> -> /tmp/install_ruby
[production.foobar.com] /tmp/install_ruby
[production.foobar.com] done
* sftp upload complete
* executing "sudo -p 'sudo password: ' bash -l /tmp/install_ruby"
servers: ["production.foobar.com"]
[production.foobar.com] executing command
** [out :: production.foobar.com] Compiling and installing ruby 1.9.3. This may take a while ...
command finished in 1603ms
triggering after callbacks for `rubber:base:install_ruby'
* 2013-07-11 01:02:29 executing `rubber:install_gems'
servers: ["production.foobar.com"]
** sftp upload #<StringIO:0x000000033d5920> -> /tmp/gem_helper
[production.foobar.com] /tmp/gem_helper
[production.foobar.com] done
* sftp upload complete
* executing "sudo -p 'sudo password: ' bash -l -c 'ruby /tmp/gem_helper install $CAPISTRANO:VAR$'"
servers: ["production.foobar.com"]
[production.foobar.com] executing command
** ruby: no such file to load -- ubygems (LoadError)
command finished in 851ms
failed: "/bin/bash -l -c 'sudo -p '\\''sudo password: '\\'' bash -l -c '\\'' \
ruby /tmp/gem_helper install open4 aws-s3 bundler rubber:2.5.2 \
gelf graylog2_exceptions graylog2-resque pg fastthread rack \
passenger:3.0.19 puma'\\'''" on production.foobar.com
检查一个Ruby安装的/ usr /本地/红宝石
通过的 SSH 的服务器上显示,它有尚未安装
Checking for a Ruby installation in /usr/local/rubies
via ssh on the server shows that it has not been installed.
这是张贴在Freenode的IRC的#rubberec2 的作为我的问题评论:
This was posted in the freenode IRC #rubberec2 as a comment on my problem:
不过,我想不出如何应用这个到橡胶配置。
However, I cannot figure out how to apply this onto the Rubber configuration.
推荐答案
由于在这个问题说我产生了橡胶的配置文件,包括橡胶ruby.yml
。
As stated in the question I generated the configuration files for Rubber including rubber-ruby.yml
.
# config/rubber/rubber-ruby.yml
...
ruby_build_version: 20130501
ruby_version: 1.9.3
...
我重复整个过程与橡胶相同版本(我只是固定的版本 2.5.2
,因为有更新同时)。这一次,我注意到 RUBY_VERSION
设置为 1.9.3-P392
正如你所看到的。看来,如果我无意中修改这个设置?!
I repeated the whole process with the same version of Rubber (I just fixed the version to 2.5.2
since there is an update meanwhile). This time I noticed that the ruby_version
is set to 1.9.3-p392
as you can see here. It seems as if I accidently modified this setting?!
复归这种变化在部署的实际工作作为预期。
Reverting this change the deployment actually works as expected.
如上所述,在此期间橡胶2.5.3出版含有更新设置 :
As mentioned, in the meantime Rubber 2.5.3 was published which contains updated settings:
# config/rubber/rubber-ruby.yml
...
ruby_build_version: 20130628
ruby_version: 1.9.3-p448
...
我也尝试了新版本对于那些谁是好奇。它的工作原理也是如此。
非常感谢凯文·梅纳尔和马特·康韦谁坚持回答我的问题,在项目的IRC频道。
I also tried the new version for those who are curious. It works as well.
Big thanks to Kevin Menard and Matt Conway who persevered answering my questions in the IRC channel of the project.
这篇关于红宝石:没有这样的文件加载 - ubygems(LoadError)运行冠橡胶时:create_staging的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!