Rails 4不检测应用程序

Jon*_*ard 15 ruby-on-rails ruby-on-rails-4

更新到Rails 4后,我正在尝试启动服务器,但它无法启动.简单地说,应用程序似乎没有被"检测到",就像那里没有应用程序一样.

~ $ 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
Run Code Online (Sandbox Code Playgroud)

奇怪的是,(较旧的)系统宝石会让它开始很好,但不适用于Bundler.

为什么Rails不会启动?

我尝试导航CLI源代码,但我无法控制正在发生的事情.

(使用Edge Rails 4.0.0.beta和Ruby 2.0.0.rc)

如果你想知道,这里是目录列表:

~ $ ls
app  config db    Gemfile   lib  mock    Rakefile   script  tmp
bin  config.ru  features  Gemfile.lock  log  public  README.md  spec    vendor
Run Code Online (Sandbox Code Playgroud)

Jon*_*ard 35

Rails 4确实改变了它启动的方式.

幸运的是,您不必运行rails-new,因为有一个方便的任务.

Rails 4发行说明:

6.1值得注意的变化

  • 您的应用程序的可执行文件现在位于bin/目录中.运行rake rails:update:bin来获得bin/bundle,bin/railsbin/rake.