【问题标题】:Already initialized constant APP PATH rails已经初始化的常量 APP PATH rails
【发布时间】:2015-04-20 06:41:32
【问题描述】:

在我的应用程序中安装 devise 3.4.0 gem 后,我收到了这个错误。当我在终端中输入rails s 时,出现以下错误..

[kmartin@localhost register]$ rails s
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
bin/rails:6: warning: already initialized constant APP_PATH
/home/kmartin/work/register/bin/rails:6: warning: previous definition of APP_PATH was here
Usage: rails COMMAND [ARGS]

The most common rails commands are:
 generate    Generate new code (short-cut alias: "g")
 console     Start the Rails console (short-cut alias: "c")
 server      Start the Rails server (short-cut alias: "s")
 dbconsole   Start a console for the database specified in config/database.yml
             (short-cut alias: "db")
 new         Create a new Rails application. "rails new my_app" creates a
             new application called MyApp in "./my_app"

In addition to those, there are:
 destroy      Undo code generated with "generate" (short-cut alias: "d")
 plugin new   Generates skeleton for developing a Rails plugin
 runner       Run a piece of code in the application environment (short-cut alias: "r")

All commands can be run with -h (or --help) for more information.

【问题讨论】:

  • @shivam 我已经检查了该链接,似乎那里的所有解决方案都不适用于我的错误无法弄清楚原因
  • rake rails:update:bin 返回什么?
  • @shivam 它覆盖了以前的 bin/rails 文件,当我运行 rails s 时,它给了我未初始化常量 Mart 的错误。Mart 是我创建的设计用户...[kmartin@localhost register] $ rake rails:update:bin 存在 bin 相同的 bin/bundle 冲突 bin/rails 覆盖 /home/kmartin/work/register/bin/rails? (输入“h”寻求帮助)[Ynaqdh] Y 强制 bin/rails 相同 bin/rake 相同 bin/setup
  • 尝试运行rails c - 你应该得到一个更明确的错误

标签: ruby ruby-on-rails-4 devise


【解决方案1】:

我实际上只是从 3.1 更改了我的设计 gem。只需 gem 'devise' 然后安装捆绑包,我的问题就解决了......似乎 rails 4 不支持 devise 的版本。

【讨论】:

  • 如果您认为自己的答案解决了您的问题,并且应该解决了问题,那么请接受它。
  • @ArslanAli 虽然你不能在 2 天过去之前接受你自己的答案,但它确实做到了
猜你喜欢
  • 1970-01-01
  • 2012-10-08
  • 2011-12-29
  • 2011-08-29
  • 2011-08-20
  • 1970-01-01
  • 2011-12-01
  • 2011-01-02
  • 2013-01-08
相关资源
最近更新 更多