Rails 4 不检测应用程序 [英] Rails 4 doesn't detect application
问题描述
更新到 Rails 4 后,我试图启动服务器,但它无法启动.简单地说,应用程序似乎没有被检测到",就像那里没有应用程序一样.
After updating to Rails 4, I'm trying to start the server, but it won't start. Simply put, the application doesn't seem to get "detected", like there is no application in there.
~ $ bundle exec rails server
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /app/vendor/ruby-2.0.0/bin/ruby
-b, [--builder=BUILDER] # Path to some application builder (...
-m, [--template=TEMPLATE] # Path to some application template (...
[--skip-gemfile] # Don't create a Gemfile
-B, [--skip-bundle] # Don't run bundle install
奇怪的是,(较旧的)系统 gem 可以让它很好地启动,但不适用于 Bundler.
What is weird is that the (older) system gem will make it start just fine, but not with Bundler.
为什么 Rails 无法启动?
Why won't Rails start?
我尝试浏览 CLI 源代码,但我无法掌握发生了什么.
I tried navigating the CLI source code, but I can't grip what's going on.
(使用 Edge Rails 4.0.0.beta 和 Ruby 2.0.0.rc)
(Using Edge Rails 4.0.0.beta and Ruby 2.0.0.rc)
如果您想知道,这里是目录列表:
In case you're wondering, here's the directory listing:
~ $ ls
app config db Gemfile lib mock Rakefile script tmp
bin config.ru features Gemfile.lock log public README.md spec vendor
推荐答案
Rails 4 确实改变了它的启动方式.
Rails 4 did change the way it boots up.
幸运的是,您不必运行 rails-new
,因为有一个方便的任务.
Fortunately, you don't have to run rails-new
, since there is a handy task for that.
- 您应用的可执行文件现在位于
bin/
目录中.运行rake rails:update:bin
得到bin/bundle
、bin/rails
和bin/rake
.
6.1 Notable changes
- Your app's executables now live in the
bin/
dir. Runrake rails:update:bin
to getbin/bundle
,bin/rails
, andbin/rake
.
这篇关于Rails 4 不检测应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!