将Ubuntu从10.04更新到14.04后,Rails无法正常工作

时间:2014-09-20 15:36:49

标签: ruby-on-rails-4 updates ubuntu-14.04

我在Ubuntu 10.04中安装了Rails。并启动并运行了一些应用程序。但在将Ubuntu更新到14.04之后,rails应用程序无法运行。

当我尝试启动我的Rails应用程序(作为$ rails服务器)时,我收到以下警告和帮助:

bin/rails:6: warning: already initialized constant APP_PATH
/home/razor/rails_projs/simple_cms/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:
 application  Generate the Rails application code
 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.

2 个答案:

答案 0 :(得分:0)

当我错误地尝试从app目录外部运行rails服务器并再次从gem / engine目录中运行时,发生了这种情况。你能确认你在你的主应用程序中吗?如果你的应用名称是simple_cms,它看起来就像你一样。

如果是这样,那么当你运行

时会得到什么
type rails

which rails

奇怪的是,它为您提供了在应用内创建应用的选项,这是不可能的。您安装了哪个版本的导轨?

答案 1 :(得分:0)

This link,帮我解决了这个问题。 我不得不卸载mysql2 gem然后重新安装它。

我使用的命令

$gem uninstall mysql2
$gem install mysql2

比一切都好,可以启动服务器。