我正在使用https://github.com/alindeman/upgradingtorails4/releases/tag/v1.1.0更新到Rails 4。
我按照指示操作,除了这个错误:rake aborted! uninitialized constant Rails::SubTestTask
。
运行bundle exec rake assets:precompile
时,以及运行git push heroku master
时发生错误。
我运行git push heroku master
后,导致my site失效。如何修复此错误并重新启动我的网站?
更新:这是一些heroku日志。我不确定其他相关信息是什么。
2014-01-19T04:21:17.711128+00:00 heroku[web.1]: State changed from crashed to starting
2014-01-19T04:21:23.293242+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 10646 -e $RAILS_ENV`
2014-01-19T04:21:24.362457+00:00 app[web.1]: bash: bin/rails: No such file or directory
2014-01-19T04:21:25.944038+00:00 heroku[web.1]: Process exited with status 127
2014-01-19T04:21:25.959784+00:00 heroku[web.1]: State changed from starting to crashed
2014-01-19T04:23:01.936377+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/wofford/academics/professors/how-strong-is-the-alumni-network host=www.collegeanswerz.com request_id=0f280641-e72c-47f3-922c-054256214579 fwd="180.76.6.140" dyno= connect= service= status=503 bytes=
2014-01-19T04:25:06.914297+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/robots.txt host=www.collegeanswerz.com request_id=176cd299-7f1c-4985-9195-289874e45ffa fwd="66.249.66.216" dyno= connect= service= status=503 bytes=
2014-01-19T04:25:07.045522+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/southern-illinois-university-carbondale/academics/classes/what-was-your-least-favorite-class host=www.collegeanswerz.com request_id=45c36f78-742f-4a08-9b9a-351b2bf27d0f fwd="66.249.66.216" dyno= connect= service= status=503 bytes=
application.rb中
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
# require "active_resource/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
module Collegeanswers
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true
# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Enforce whitelist mode for mass assignment.
# This will create an empty whitelist of attributes available for mass-assignment for all models
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
# parameters by using an attr_accessible or attr_protected declaration.
config.active_record.whitelist_attributes = true
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
end
end
development.rb
Collegeanswers::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
config.eager_load = false
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
end
production.rb
Collegeanswers::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Add the fonts path
config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
# Code is not reloaded between requests
config.cache_classes = true
config.eager_load = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
# Defaults to nil and saved in location specified by config.assets.prefix
# config.assets.manifest = YOUR_PATH
# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# See everything in the log (default is :info)
# config.log_level = :debug
# Prepend all log lines with the following tags
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
config.assets.precompile += %w( about_college.css college_pages.css colleges.css essay_list.css
essays.css home.css layout.css static_pages.css tldr.css college_pages.js essays.js home.js static_pages.js favicon.ico .svg .eot .woff .ttf)
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => 'baci.lindsaar.net',
:user_name => 'azerner3@gmail.com',
:password => 'ahdumzurnurthre',
:authentication => 'plain',
:enable_starttls_auto => true }
config.action_controller.asset_host = "https://#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"
end
test.rb
Collegeanswers::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
end
rake任务输出失败
~/collegeanswerz >> rake rails:update
rake aborted!
uninitialized constant Rails::SubTestTask
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/rails-perftest-0.0.3/lib/rails/perftest/railties/testing.tasks:6:in `block in <top (required)>'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/rails-perftest-0.0.3/lib/rails/perftest/railties/testing.tasks:1:in `<top (required)>'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/rails-perftest-0.0.3/lib/rails/perftest/railtie.rb:8:in `block in <class:Railtie>'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/railtie.rb:201:in `instance_exec'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/railtie.rb:201:in `block in run_tasks_blocks'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/railtie.rb:201:in `each'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/railtie.rb:201:in `run_tasks_blocks'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/application.rb:243:in `block in run_tasks_blocks'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/engine/railties.rb:17:in `each'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/engine/railties.rb:17:in `each'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/application.rb:243:in `run_tasks_blocks'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/engine.rb:446:in `load_tasks'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/adamzerner/collegeanswerz/Rakefile:7:in `<top (required)>'
(See full trace by running task with --trace)
~/collegeanswerz >>
更新
~/collegeanswerz >> rake rails:update
conflict config/boot.rb
Overwrite /Users/adamzerner/collegeanswerz/config/boot.rb? (enter "h" for help) [Ynaqdh] bundle install
Y - yes, overwrite
n - no, do not overwrite
a - all, overwrite this and all others
q - quit, abort
d - diff, show the differences between the old and the new
h - help, show this help
Overwrite /Users/adamzerner/collegeanswerz/config/boot.rb? (enter "h" for help) [Ynaqdh] a
force config/boot.rb
exist config
conflict config/routes.rb
force config/routes.rb
conflict config/application.rb
force config/application.rb
conflict config/environment.rb
force config/environment.rb
exist config/environments
conflict config/environments/development.rb
force config/environments/development.rb
conflict config/environments/production.rb
force config/environments/production.rb
conflict config/environments/test.rb
force config/environments/test.rb
exist config/initializers
identical config/initializers/backtrace_silencers.rb
create config/initializers/filter_parameter_logging.rb
conflict config/initializers/inflections.rb
force config/initializers/inflections.rb
identical config/initializers/mime_types.rb
conflict config/initializers/secret_token.rb
force config/initializers/secret_token.rb
conflict config/initializers/session_store.rb
force config/initializers/session_store.rb
conflict config/initializers/wrap_parameters.rb
force config/initializers/wrap_parameters.rb
exist config/locales
conflict config/locales/en.yml
force config/locales/en.yml
create bin
create bin/bundle
create bin/rails
create bin/rake
~/collegeanswerz >> rake rails:update
identical config/boot.rb
exist config
identical config/routes.rb
identical config/application.rb
identical config/environment.rb
exist config/environments
identical config/environments/development.rb
identical config/environments/production.rb
identical config/environments/test.rb
exist config/initializers
identical config/initializers/backtrace_silencers.rb
identical config/initializers/filter_parameter_logging.rb
identical config/initializers/inflections.rb
identical config/initializers/mime_types.rb
conflict config/initializers/secret_token.rb
Overwrite /Users/adamzerner/collegeanswerz/config/initializers/secret_token.rb? (enter "h" for help) [Ynaqdh] a
force config/initializers/secret_token.rb
identical config/initializers/session_store.rb
identical config/initializers/wrap_parameters.rb
exist config/locales
identical config/locales/en.yml
exist bin
identical bin/bundle
identical bin/rails
identical bin/rake
~/collegeanswerz >> rake rails:update
identical config/boot.rb
exist config
identical config/routes.rb
identical config/application.rb
identical config/environment.rb
exist config/environments
identical config/environments/development.rb
identical config/environments/production.rb
identical config/environments/test.rb
exist config/initializers
identical config/initializers/backtrace_silencers.rb
identical config/initializers/filter_parameter_logging.rb
identical config/initializers/inflections.rb
identical config/initializers/mime_types.rb
conflict config/initializers/secret_token.rb
Overwrite /Users/adamzerner/collegeanswerz/config/initializers/secret_token.rb? (enter "h" for help) [Ynaqdh] a
force config/initializers/secret_token.rb
identical config/initializers/session_store.rb
identical config/initializers/wrap_parameters.rb
exist config/locales
identical config/locales/en.yml
exist bin
identical bin/bundle
identical bin/rails
identical bin/rake
~/collegeanswerz >> rake rails:update
identical config/boot.rb
exist config
identical config/routes.rb
identical config/application.rb
identical config/environment.rb
exist config/environments
identical config/environments/development.rb
identical config/environments/production.rb
identical config/environments/test.rb
exist config/initializers
identical config/initializers/backtrace_silencers.rb
identical config/initializers/filter_parameter_logging.rb
identical config/initializers/inflections.rb
identical config/initializers/mime_types.rb
conflict config/initializers/secret_token.rb
Overwrite /Users/adamzerner/collegeanswerz/config/initializers/secret_token.rb? (enter "h" for help) [Ynaqdh] a
force config/initializers/secret_token.rb
identical config/initializers/session_store.rb
identical config/initializers/wrap_parameters.rb
exist config/locales
identical config/locales/en.yml
exist bin
identical bin/bundle
identical bin/rails
identical bin/rake
~/collegeanswerz >> bundle install
Using rake (10.1.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.8.4)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.38)
Using activesupport (4.0.2)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.2)
Using mime-types (1.25.1)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.2)
Using actionpack-action_caching (1.0.0)
Using actionpack-page_caching (1.0.2)
Using actionpack-xml_parser (1.0.1)
Using activemodel (4.0.2)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.1)
Using activerecord (4.0.2)
Using bundler (1.5.2)
Using thor (0.18.1)
Using railties (4.0.2)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.10.1)
Using sprockets-rails (2.0.1)
Using rails (4.0.2)
Using actionview-encoded_mail_to (1.0.4)
Using activerecord-session_store (0.0.1)
Using rails-observers (0.1.2)
Using activeresource (4.0.0)
Using annotate (2.5.0)
Using excon (0.31.0)
Using formatador (0.2.4)
Using net-ssh (2.7.0)
Using net-scp (1.1.2)
Using mini_portile (0.5.2)
Using nokogiri (1.6.1)
Using ruby-hmac (0.4.0)
Using fog (1.19.0)
Using asset_sync (1.0.0)
Using sass (3.2.13)
Using bootstrap-sass (2.3.2.0)
Using chart-js-rails (0.0.6)
Using coffee-script-source (1.6.3)
Using execjs (2.0.2)
Using coffee-script (2.2.0)
Using coffee-rails (4.0.1)
Using dynamic_form (1.1.4)
Using sass-rails (4.0.1)
Using fontello-rails (0.2.0)
Using json (1.8.1)
Using multi_xml (0.5.5)
Using httparty (0.12.0)
Using jquery-rails (3.0.4)
Using jquery-tablesorter (1.9.5)
Using turbolinks (2.2.0)
Using jquery-turbolinks (2.0.1)
Using jquery-ui-rails (4.1.1)
Using jquery-ui-themes (0.0.11)
Using protected_attributes (1.0.3)
Using rails-perftest (0.0.3)
Using terminal-table (1.4.5)
Using rails4_upgrade (0.5.0)
Using rails_serve_static_assets (0.0.2)
Using rails_stdout_logging (0.0.3)
Using rails_12factor (0.0.2)
Using ruby-prof (0.14.2)
Using sqlite3 (1.3.8)
Using test-unit (2.5.5)
Using uglifier (2.4.0)
Your bundle is complete!
Gems in the group production were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
~/collegeanswerz >> bundle exec rake assets:precompile
I, [2014-01-19T12:35:27.559511 #45119] INFO -- : Writing /Users/adamzerner/collegeanswerz/public/assets/PTC55F-8a51a8dbd99ebb64038e5bc5d889e8de.ttf
I, [2014-01-19T12:35:27.603802 #45119] INFO -- : Writing /Users/adamzerner/collegeanswerz/public/assets/PTC75F-67e3622fa715992a353cf8e9aacabfaa.ttf
I, [2014-01-19T12:35:27.645882 #45119] INFO -- : Writing /Users/adamzerner/collegeanswerz/public/assets/PTN57F-d8ef42f92a175dc6266e65be28770e40.ttf
I, [2014-01-19T12:35:27.689838 #45119] INFO -- : Writing /Users/adamzerner/collegeanswerz/public/assets/PTN77F-e7f569a81079fe2197f6e0f0530a1242.ttf
I, [2014-01-19T12:35:27.748504 #45119] INFO -- : Writing /Users/adamzerner/collegeanswerz/public/assets/PTS55F-df874aeb0825a39cd66881f24804c5a4.ttf
I, [2014-01-19T12:35:27.836106 #45119] INFO -- : Writing /Users/adamzerner/collegeanswerz/public/assets/PTS56F-58bf799abff6c2cc0891f78a7f29ce90.ttf
I, [2014-01-19T12:35:27.952892 #45119] INFO -- : Writing /Users/adamzerner/collegeanswerz/public/assets/PTS75F-96b0ec122b6968fcac0399137ab4ce44.ttf
然后它以......结束。
I, [2014-01-19T12:37:19.312625 #45119] INFO -- : Writing /Users/adamzerner/collegeanswerz/public/assets/jquery-ui/ui-icons_cd0a0a_256x240-261647ac915575f3981ded254ae8d43e.png
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
rake aborted!
Fog provider can't be blank, Fog directory can't be blank
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/asset_sync-1.0.0/lib/asset_sync/asset_sync.rb:48:in `with_config'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/asset_sync-1.0.0/lib/asset_sync/asset_sync.rb:28:in `sync'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/asset_sync-1.0.0/lib/tasks/asset_sync.rake:5:in `block (2 levels) in <top (required)>'
/Users/adamzerner/.rvm/gems/ruby-2.0.0-p353/gems/asset_sync-1.0.0/lib/tasks/asset_sync.rake:28:in `block in <top (required)>'
Tasks: TOP => assets:sync
(See full trace by running task with --trace)
~/collegeanswerz >>
更新2
I, [2014-01-19T17:51:31.171362 #1823] INFO -- : Writing /tmp/build_d25c5b42-f835-4294-b974-e70e2831b580/public/assets/jquery-ui/ui-icons_888888_256x240-ce584ffa171c3ea9a018cf0d7bec65c8.png
I, [2014-01-19T17:51:31.174172 #1823] INFO -- : Writing /tmp/build_d25c5b42-f835-4294-b974-e70e2831b580/public/assets/jquery-ui/ui-icons_cd0a0a_256x240-747e96029e8dedcabc224e5f7d1f2ede.png
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
rake aborted!
Fog provider can't be blank, Fog directory can't be blank
/tmp/build_d25c5b42-f835-4294-b974-e70e2831b580/vendor/bundle/ruby/2.0.0/gems/asset_sync-1.0.0/lib/asset_sync/asset_sync.rb:48:in `with_config'
/tmp/build_d25c5b42-f835-4294-b974-e70e2831b580/vendor/bundle/ruby/2.0.0/gems/asset_sync-1.0.0/lib/asset_sync/asset_sync.rb:28:in `sync'
/tmp/build_d25c5b42-f835-4294-b974-e70e2831b580/vendor/bundle/ruby/2.0.0/gems/asset_sync-1.0.0/lib/tasks/asset_sync.rake:5:in `block (2 levels) in <top (required)>'
/tmp/build_d25c5b42-f835-4294-b974-e70e2831b580/vendor/bundle/ruby/2.0.0/gems/asset_sync-1.0.0/lib/tasks/asset_sync.rake:28:in `block in <top (required)>'
Tasks: TOP => assets:sync
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
To git@heroku.com:fast-reaches-9399.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:fast-reaches-9399.git'
~/collegeanswerz >>
答案 0 :(得分:1)
在本地副本中尝试运行:
rake rails:update:bin
或使用bundler:
bundle exec rake rails:update:bin
这将为您生成所需的bin存根。将它们提交到您的存储库并将所有内容推送到heroku。
如果您之前没有运行它,则可能需要运行rake rails:update
来执行所有更新操作。
rake -T
输出中可用的选项:
rake rails:update # Update configs and some other initially generated files (or use just update:configs, update:bin, or update:application_controller)
更新:
听起来你的旧Rails 3文件与项目混在一起会导致错误。
您应该创建一个空白的新Rails 4应用程序,并浏览每个生成的文件,将它们与您自己的文件进行比较。特别是application.rb
和各种环境配置覆盖文件。
答案 1 :(得分:1)
Rails::SubTestTask
是为测试定义的任务。但是你正在尝试部署到生产环境。这听起来像是在某个地方你试图包含Rails测试库,它们不在捆绑中,导致该任务无法定义。您是否检查过代码是否有Rails::SubTestTask
的引用?
如果您无法在本地运行rake
,那么它将不会在Heroku上运行,这是一个不错的选择。也许您可以在运行rake时添加错误日志,但它失败了uninitialized constant