更新到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
什么是奇怪的是,(较旧的)系统宝石将使它开始很好,但不是与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
解决方法
Rails 4改变了它启动的方式.
幸运的是,您不必运行rails-new,因为有一个方便的任务.
6.1Notable changes
- Your app’s executables now live in the
bin/
dir. Runrake rails:update:bin
to getbin/bundle
,bin/rails
,andbin/rake
.