将Ubuntu从10.04更新到14.04后Rails无法正常工作
我在Ubuntu 10.04中安装了Rails。并且有一些应用程序正在运行。但在将Ubuntu更新到14.04后,rails应用程序无法正常工作。将Ubuntu从10.04更新到14.04后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.
这发生在我身上时,我错误地试图从外部运行轨道服务器app目录,然后再从一个gem/engine目录中找到。你能确认你在你的主应用程序内吗?看起来你是,如果你的应用名称是simple_cms。
如果是这样,那么你得到了什么,当你运行
type rails
和
which rails
它的怪异,它使您能够从一个应用程序中创建一个应用程序的选项,这ISN”可能。你安装了哪个版本的导轨?
是的,我从我的应用程序内运行rails服务器。命令的输出如下: $ type rails 'rails hashed(/home/razor/.rvm/gems/ruby-2.1.2/bin/rails)' $ which rails '/ home/razor/.rvm/gems/ruby-2.1.2/bin/rails' – rAzOr 2014-09-20 17:41:25
你也可以给我rails版吗?我认为这个命令是rails -v,也是你的应用程序使用的rails版本。你是否也可以尝试在其中创建一个新的rails应用程序和运行rails服务器。 – CleoR 2014-09-21 01:43:47
Rails版本:'4.1.6' 尝试使用新应用程序,即使这样也会得到相同的结果。 – rAzOr 2014-09-21 04:16:37
This link,帮我解决了这个问题。 我不得不卸载mysql2宝石,然后重新安装它。
命令我用
$gem uninstall mysql2
$gem install mysql2
比一切都很好,可以启动服务器。
在将ubuntu更新到14.04时,它询问我是否要删除一些过时的软件包。并选择是的,这很重要吗? – rAzOr 2014-09-20 15:38:49