- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我想我搞砸了我的一个项目,现在它几乎无法运行任何命令。
最初我都是通过 RVM 安装的。 Gemfile 显示 rails 4.1.3
一段时间后,我想我可能会尝试更新 rails 并启动几个其他项目,其中 rails 版本是 4.2.0 并且都运行良好。
最近我回到了第一个项目来部署它。当我注意到我无法在我的工作机器上运行任何开发命令时,我正在配置 Capistrano。首先我尝试运行服务器但是出现了这个错误:
$ rails server
bin/rails:6: warning: already initialized constant APP_PATH
/home/axl/coding/bfq/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.
所以我想也许我用 Capistrano 搞砸了,所以我回到了分支机构,但错误仍然存在。
任何 rake 调用都会返回这个:
$ rake db:setup
rake aborted!
Gem::LoadError: You have already activated rake 10.4.2, but your Gemfile requires rake 10.3.2. Prepending `bundle exec` to your command may solve this.
/home/axl/coding/bfq/config/boot.rb:4:in `<top (required)>'
/home/axl/coding/bfq/config/application.rb:1:in `<top (required)>'
/home/axl/coding/bfq fiscal-quadrum/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- bundler/setup
/home/axl/coding/bfq/config/boot.rb:4:in `<top (required)>'
/home/axl/coding/bfq/config/application.rb:1:in `<top (required)>'
/home/axl/coding/bfq/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
按照建议在 bundle exec
之前显示另一个错误。例如:
$ bundle exec rake db:setup
rake aborted!
LoadError: cannot load such file -- gserver
/home/axl/coding/bfq/config/application.rb:7:in `<top (required)>'
/home/axl/coding/bfq/Rakefile:4:in `require'
/home/axl/coding/bfq/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
也有类似的情况,报错bin/rails:6: warning: already initialized constant APP_PATH
与spring gem有关。运行 rake rails:update:bin 似乎有帮助,但我无法运行它,因为 rake 根本不起作用。
所以我尝试重新安装 RVM。但是什么都没有改变。我什至删除了 RVM 并安装了 Rbenv。但一切都完全一样。
项目内的版本:
$ ruby --version
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
$ gem --version
2.4.5
$ rake --version
rake, version 10.4.2
$ rails --version
Rails 4.1.6
bundle update
进行了一些更新,但之后执行 rake 显示与前置 bundle exec
相同的错误:
$ rake
rake aborted!
LoadError: cannot load such file -- gserver
/home/axl/coding/bfq/config/application.rb:7:in `<top (required)>'
/home/axl/coding/bfq/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
谷歌搜索没有任何用处 LoadError: cannot load such file -- gserver
请帮帮我:'(
最佳答案
我真丢人。我没有为项目定义 ruby 本地版本。
使用 RVM 时:
$ rvm install 2.1.1
$ rvm use 2.1.1
对于 Rbenv:
$ rbenv install 2.1.1
$ rbenv local 2.1.1
关于ruby-on-rails - 加载错误 : cannot load such file -- gserver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27975312/
我通过实现最基本的服务器来测试 GServer 的性能,并检查它每秒可以处理多少请求。结果是 81。与我最基本的 TCPSocket 服务器可以处理的每秒 9900 个请求相比,这是非常慢的。是我做错
TCPServer.new(port) 创建一个服务器,可以为来自本地主机或远程机器的请求提供服务。 但是 GServer.new(port) 创建的服务器只能为来自本地主机的请求提供服务。 在查看
我有以下 Ruby 脚本: class Server < GServer def initialize super(10001) end def serve(io) whil
我想我搞砸了我的一个项目,现在它几乎无法运行任何命令。 最初我都是通过 RVM 安装的。 Gemfile 显示 rails 4.1.3 一段时间后,我想我可能会尝试更新 rails 并启动几个其他项目
我正在尝试构建一个基于 Web 的聊天系统,我将使用 ruby gserver。我看过this example .但是我的问题是当我从网络上获取用户输入时,在 Controller 中我有用户输入
我是一名优秀的程序员,十分优秀!