2

人们,

我是 ROR 的新手,不是全新的(不再),但对将应用程序转移到生产环境没有经验。为了了解迁移到生产流程的工作原理,我创建了一个非常简单的 rails 项目。以下是关于我的系统的一些基本信息(在 Windows 7 上运行):

Ruby version                1.9.3 (i386-mingw32)
RubyGems version            1.8.24
Rack version                1.4
Rails version               3.2.8
JavaScript Runtime          JScript
Active Record version       3.2.8
Action Pack version         3.2.8
Active Resource version     3.2.8
Action Mailer version       3.2.8
Active Support version      3.2.8
Application root            C:/Sites/railstest
Environment                 development
Database adapter            sqlite3
Database schema version     0

中间件:

ActionDispatch::Static
Rack::Lock
#<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x2a70f20>
Rack::Runtime
Rack::MethodOverride
ActionDispatch::RequestId
Rails::Rack::Logger
ActionDispatch::ShowExceptions
ActionDispatch::DebugExceptions
ActionDispatch::RemoteIp
ActionDispatch::Reloader
ActionDispatch::Callbacks
ActiveRecord::ConnectionAdapters::ConnectionManagement
ActiveRecord::QueryCache
ActionDispatch::Cookies
ActionDispatch::Session::CookieStore
ActionDispatch::Flash
ActionDispatch::ParamsParser
ActionDispatch::Head
Rack::ConditionalGet
Rack::ETag
ActionDispatch::BestStandardsSupport

我的虚拟主机是网络主机。

这就是我所做的:

  1. 使用以下命令生成一个名为 railstest 的新 Rails 应用程序: rails new railstest
  2. 用我的虚拟主机上使用的版本更新了 gemfile
  3. 运行“bundle install --deployment”以在供应商目录中拥有所有 gem。
  4. 将所有内容通过 FTP 传输到虚拟主机
  5. 通过 PuTTY 成功运行捆绑安装

但是当我打电话给该网站时,我总是会得到这样的信息:http: //www.kernification.de/rails/info/properties (我没有足够的声誉在这里发布图片......)

我已经尝试了更多(我现在正在为这个问题争取大约 1.5 周),但它似乎一直都是同一个问题。网络主机支持告诉我 gem 位于 1.9.1,而不是 1.8,我对此有一些疑问:

  1. 1.9.1(或1.8)的版本是什么?红宝石?宝石?
  2. 我如何强制在 1.9.1 而不是 1.8 中寻找宝石?

我也尝试使用 pik 作为版本管理器,但到目前为止我只会使用 webhostone,所以如果我安装了一个可以工作的 ruby​​ 版本,我会很高兴。到目前为止,我不需要在任何版本之间切换。我也搬到了 xubuntu,在那里创建了同样简单的应用程序,同样的结果。

如果能分享一下经验就更好了,万分感谢!

4

2 回答 2

0

您列出的版本号与 Ruby 版本匹配。可以通过设置 GEM_HOME 环境变量告诉 Rubygems 在哪里寻找本地 gem 存储库。但这可能不是您想要做的,因为 Bundler 应该提供所有的宝石。

通过调用bundle install --deployment您的应用程序需要的所有 gem,应该将其捆绑在vendor/bundle目录中。因此,我不明白您为什么bundle install在部署站点上再次调用。

您可以检查部署服务器上的应用程序文件夹是否包含rake捆绑到vendor/deploy.

于 2012-11-06T20:23:12.190 回答
0

I had a call with my webhost support and it looks like the issue was related to the apache configuration. It is still not fixed but the issue described above is gone. Now there is a new issue but this is a different story and I will search in this really great forum first. Thanks a lot for your help.

于 2012-11-07T20:02:21.260 回答