我目前正在开发一个Rails应用程序,作为另一个Rails应用程序的更新程序。从Rails应用程序中用反引号启动另一个Rails服务器
我有更新过程中的工作,
- 下载新版本的zip
- 提取到正确的位置
- 同步资产
- 捆绑安装
- 预编译资产
- 启动服务器 - bundle exec rails server
我遇到了最后一步的问题。
当我运行:
Dir.chdir('../other-project')
`bundle exec rails server -d -p 3000`
从它似乎是从更新器拉更新应用程序捆绑 ,而不是它应该成为拉动新的应用程序包。
的更新是写在轨道4和应用程序是更新是轨道3
当我尝试启动,我得到的服务器如下:
/home/vagrant/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/railtie/configuration.rb:95:in `method_missing': undefined method `handlebars' for #<Rails::Application::Configuration:0x007f9de18de100> (NoMethodError)
from /home/vagrant/apps/other-project/config/application.rb:22:in `<class:Application>'
from /home/vagrant/apps/other-project>'
from /home/vagrant/apps/other-project/config/application.rb:13:in `<top (required)>'
from /home/vagrant/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:79:in `require'
from /home/vagrant/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from /home/vagrant/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /home/vagrant/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server'
from /home/vagrant/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /home/vagrant/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
从这个输出,我可以告诉它试图使用不正确的railties版本...
当我手动cd ../other-project
和bundle exec rails server -d -p 3000
它工作正常。
是否有任何可用于解决此问题的bash技巧? 基盒是Ubuntu 14.04
谢谢!
为什么使用整个rails应用程序来执行这个程序任务?您可以使用bash脚本完成此操作 – kendotwill 2014-10-06 22:38:46
@kendotwill此应用程序的目的是为嵌入式rails应用程序提供前端更新程序/控制器。这两种轨道应用都运行在一个流浪箱中。一个bash脚本可以工作,但用户无法按需更新。 – 2014-10-07 02:25:22