gpt4 book ai didi

ruby-on-rails - 箱/rails :6: warning: already initialized constant APP_PATH

转载 作者:太空宇宙 更新时间:2023-11-03 16:50:05 25 4
gpt4 key购买 nike

我正在尝试执行我的 RoR 应用程序,但是当我执行命令时:rails s 显示以下错误:

/Users/Jarvis/Documents/Projects/Vincubo/vincubo/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")

但是,当我执行命令时:

$ rake rails:update:bin

rake aborted!
LoadError: dlopen(/Users/Jarvis/.rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-12/2.1.0-static/rmagick-2.13.2/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libMagickCore-6.Q16.2.dylib
Referenced from: /Users/Jarvis/.rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-12/2.1.0-static/rmagick-2.13.2/RMagick2.bundle
Reason: image not found - /Users/Jarvis/.rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-12/2.1.0-static/rmagick-2.13.2/RMagick2.bundle
/Users/Jarvis/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:247:in `require'
/Users/Jarvis/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:247:in `block in require'
/Users/Jarvis/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:232:in `load_dependency'
/Users/Jarvis/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:247:in `require'
/Users/Jarvis/.rvm/gems/ruby-2.1.1/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `<top (required)>'
/Users/Jarvis/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `require'
/Users/Jarvis/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/Users/Jarvis/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `each'
/Users/Jarvis/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `block in require'
/Users/Jarvis/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.6.3/lib/bundler/runtime.rb:61:in `each'
/Users/Jarvis/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.6.3/lib/bundler/runtime.rb:61:in `require'
/Users/Jarvis/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.6.3/lib/bundler.rb:132:in `require'
/Users/Jarvis/Documents/Projects/Vincubo/vincubo/config/application.rb:7:in `<top (required)>'
/Users/Jarvis/Documents/Projects/Vincubo/vincubo/Rakefile:4:in `require'
/Users/Jarvis/Documents/Projects/Vincubo/vincubo/Rakefile:4:in `<top (required)>'
/Users/Jarvis/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/Jarvis/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)

gem 文件:

source 'https://rubygems.org'
source 'http://rubygems.org'

if RUBY_VERSION =~ /1.9/ # assuming you're running Ruby ~1.9
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end

gem 'rails', '4.1.2'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc

gem 'spring', group: :development

gem 'cells'
gem 'paperclip'

gem "mail"
gem "jquery-fileupload-rails"

gem "therubyracer"
gem "less-rails"
gem "twitter-bootstrap-rails"

gem "rmagick"

gem 'will_paginate', '~> 3.0'
gem 'pg'
gem 'roadie'
gem 'rubyXL'

gem 'spreadsheet'
gem 'fileutils'
gem 'iconv'
gem 'roo'

最佳答案

你的配置文件在

config/initializers 

我在删除 dragonfly_s3、dragonfly 和 s3_direct_upload 时出现此错误

在执行 bundle install 和 rails s 之后

同样的错误

删除了初始化文件,它工作了

关于ruby-on-rails - 箱/rails :6: warning: already initialized constant APP_PATH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24501615/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com