正在运行Rails 2.3应用程序的本地服务器? [英] Running local server for Rails 2.3 app?

查看:73
本文介绍了正在运行Rails 2.3应用程序的本地服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在本地运行Rails 2.3应用程序.

I am trying to run a Rails 2.3 app locally.

脚本/服务器给了我这些错误:

bash: script/server: Permission denied
bash: parse_git_branch: command not found

脚本/服务器给了我错误:

/Users/stevenbrooks1111/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require': cannot load such file -- initializer (LoadError)
from /Users/stevenbrooks1111/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/stevenbrooks1111/Desktop/cssmixonline/cssweb/config/boot.rb:55:in `load_initializer'
from /Users/stevenbrooks1111/Desktop/cssmixonline/cssweb/config/boot.rb:38:in `run'
from /Users/stevenbrooks1111/Desktop/cssmixonline/cssweb/config/boot.rb:11:in `boot!'
from /Users/stevenbrooks1111/Desktop/cssmixonline/cssweb/config/boot.rb:110:in `<top (required)>'
from /Users/stevenbrooks1111/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/stevenbrooks1111/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from script/server:2:in `<main>'
bash: parse_git_branch: command not found

关于如何使它在本地运行的任何想法?

Any ideas of how I can get this to run locally?

推荐答案

这个问题是我过去一个月来一直在做的事情.我本来会喜欢使用Rails 4的,但我比尝试更了解!

This question is what I've been doing for the past month. I would have loved to use Rails 4, but I know better than to try it!

安装rvm或rbenv,然后进入正确运行此应用程序的服务器并运行

Install rvm or rbenv, then get into a server that correctly runs this app, and run

ruby --version
gem list > ~/myGems.txt

使用rvm或rbenv,安装与Ruby完全相同的版本.

Using rvm or rbenv, install the exact same version of Ruby.

(提示:每当我说完全相同"时,您都可以通过修改修订版来进行修改.例如,给定具有0.1.4版的gem,如果其后续版本为0.1.5、0.1.6和0.2.0,您可以将其提高到0.1.6,如果这样可以省去一些麻烦,修订号0.1.*应该只是漏洞修复,但次要版本0.2.0则有更高的出错几率.我保留了相同版本的Ruby,但将Rails提升到了2.3.14.)

(Tip: whenever I say "exact same", you can fudge by bumping the revision. For example, given a gem with version 0.1.4, if it has subsequent versions 0.1.5, 0.1.6, and 0.2.0, you can bump to 0.1.6, if that will save you some grief. The revision numbers, 0.1.*, are supposed to be only bug fixes. But a minor version bump, 0.2.0, has higher odds of breaking things. I kept the same version of Ruby, but I bumped rails to 2.3.14.)

使用rvm或rbenv,安装与该应用程序的主服务器上当前运行的相同版本的Ruby.

Using rvm or rbenv, install the same version of Ruby as currently runs on this app's main server.

在这个Ruby环境中(其中哪个ruby ruby​​ --version 报告正确的答案),将每个gem安装在myGems.txt中,如下所示:

Inside this Ruby environment (with both which ruby and ruby --version reporting the correct answers), install each gem in myGems.txt, like this:

gem install --ignore-dependencies --no-rdoc --no-ri my_gem -v=0.1.4

-ignore-dependencies非常重要,因为2009年的更新世时期的某些宝石没有指定其依赖项的版本.当一些笨拙的2009年宝石插入2013年的 rake 时,您将被彻底搞砸,因为还原该耙子确实非常困难.并且不要忘记将-v设置为与myGems.txt报告相同的值!

The --ignore-dependencies is critical, because some gems from the Pleistocene Epoch, 2009, don't specify their dependencies' versions. When some dumb 2009 gem pulls in the 2013 rake, you will be utterly screwed, because reverting that rake is really hard. And don't forget to set the -v to the same value as myGems.txt reports!

所有这些之后,请尝试使用简单的 rake 命令,例如 rake route .将您遇到的所有错误发布为新问题,但请记住在该主题中指出Rails 2.3,以便没人误解最新的修复程序.

After all that, try simple rake commands like rake routes. Post any bugs you get as fresh questions, but remember to point out Rails 2.3 in the subject so nobody mis-answers with the modern fixes.

如果此应用具有测试或规格,则将其运行为当务之急,因此您可以恢复TDD,依靠这些测试来进行不正确的更改.

And if this app has tests or specs, getting them running should be a top priority, so you can resume TDD, leaning on the tests to allow you to make sick changes.

这篇关于正在运行Rails 2.3应用程序的本地服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆