2016-09-19 110 views
2

在rails 5中,我在启动服务器时遇到下面的错误。如何解决服务器启动的弃用错误?

DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from require at /home/shruthi/.rvm/gems/[email protected]/gems/bundler-1.10.6/lib/bundler/runtime.rb:76) 

我试图通过更新色器件宝石一样gem 'devise', github: 'plataformatec/devise'gem "devise", '~> 4.0.0.rc1'只有gem 'devise'但没有使用修复它。

的Gemfile是,

source 'https://rubygems.org' 

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '~> 5.0.0', '>= 5.0.0.1' 
# Use sqlite3 as the database for Active Record 
gem 'mysql2' 
# Use Puma as the app server 
gem 'puma', '~> 3.0' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 
# Use CoffeeScript for .coffee assets and views 
gem 'coffee-rails', '~> 4.2' 
# See https://github.com/rails/execjs#readme for more supported runtimes 
gem 'therubyracer', platforms: :ruby 

# Use jquery as the JavaScript library 
gem 'jquery-rails' 
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 
gem 'turbolinks', '~> 5' 
# Build JSON APIs with ease. Read more:  https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.5' 
# Use Redis adapter to run Action Cable in production 
# gem 'redis', '~> 3.0' 
# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# Use Capistrano for deployment 
# gem 'capistrano-rails', group: :development 

group :development, :test do 
    # Call 'byebug' anywhere in the code to stop execution and get a  debugger console 
    gem 'byebug', platform: :mri 
end 

group :development do 
    # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 
gem 'web-console' 
gem 'listen', '~> 3.0.5' 
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
gem 'spring' 
gem 'spring-watcher-listen', '~> 2.0.0' 
end 

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 

## ------- Referred from Pinhopes -------------------- 

gem 'httpclient' 

gem 'psych' 

gem 'less-rails' 

gem "asset_sync" 

gem 'rubyzip' 

gem 'linkedin', :git => "git://github.com/pengwynn/linkedin.git" 

gem 'fb_graph' 

gem 'twitter' 
gem 'oauth' 
gem 'twitter_oauth' 

gem 'sunspot_rails' 
group :development, :test do 
    gem 'sunspot_solr' 
end 

gem 'progress_bar' 

# for shortening the Long URL before posting to twitter 
gem 'bitly' 

gem 'paperclip' 

gem 'posix-spawn' 

gem "aws-sdk" 

gem "cocaine" 

gem 'execjs' 

gem 'devise' 
gem 'devise_token_auth' 

## Used to avoid => DEPRECATION WARNING: Sprockets method `register_engine` is deprecated. & Please register a mime type using `register_mime_type` then use `register_compressor` or `register_transformer` 
gem 'sprockets', '3.6.3' 

gem 'colorize' 

gem "responds_to_parent" 

gem "simple_form" 

gem 'delayed_job' 
gem 'delayed_job_active_record' 
gem 'daemons' 

gem 'cloudfront-signer' 

gem 'docsplit' 

gem 'wicked_pdf' 
gem 'wkhtmltopdf-binary' 

gem 'geocoder' 

gem 'money' 

gem 'google_currency' 

gem 'reporter', '0.0.14.alpha' , :git => "https://github.com/kpvarma/reporter.git" 

gem 'oa-core' 

gem 'omniauth' 
gem 'omniauth-facebook' 
gem "omniauth-google-oauth2" 
gem "omniauth-linkedin-oauth2" 

gem "nokogiri" 

gem 'dalli' 

gem 'stripe' 

gem 'unicorn' 

gem 'grape' 

gem 'grape-swagger' 

gem 'roo' 

gem 'remotipart' 

gem 'streamio-ffmpeg' 

gem 'protected_attributes_continued' 

gem "spreadsheet", "0.9.0" 

# ------- For Code Optimization & CleanUp --------- 
group :development do 
    gem 'traceroute' 

    #gem 'rack-mini-profiler' 

    gem 'bullet' 

    gem 'brakeman', require: false 

    gem 'rails_best_practices' 

    gem 'rubocop', require: false 

    gem 'rubycritic', require: false 
end 

## Deadweight is used for cleaning unused CSS selectors. 
group :test do 
    gem 'colored' 
    gem 'deadweight', require: 'deadweight/hijack/rails' 
end 
#---------------------------------------------------------- 

宝石名单都喜欢,

*** LOCAL GEMS *** 

abstract_type (0.0.7) 
actioncable (5.0.0.1, 5.0.0) 
actionmailer (5.0.0.1, 5.0.0, 4.2.4, 4.2.2, 4.2.0, 4.0.2) 
actionpack (5.0.0.1, 5.0.0, 4.2.4, 4.2.2, 4.2.0, 4.0.2) 
actionview (5.0.0.1, 5.0.0, 4.2.4, 4.2.2, 4.2.0) 
activejob (5.0.0.1, 5.0.0, 4.2.4, 4.2.2, 4.2.0) 
activemodel (5.0.0.1, 5.0.0, 4.2.4, 4.2.2, 4.2.0, 4.0.2) 
activerecord (5.0.0.1, 5.0.0, 4.2.4, 4.2.2, 4.2.0, 4.0.2) 
activerecord-deprecated_finders (1.0.4, 1.0.3) 
activesupport (5.0.0.1, 5.0.0, 4.2.4, 4.2.2, 4.2.0, 4.0.2) 
adamantium (0.2.0) 
addressable (2.4.0, 2.3.8) 
andand (1.3.3) 
arel (7.1.2, 6.0.3, 6.0.0, 4.0.2) 
asset_sync (1.2.1, 1.1.0, 1.0.0) 
ast (2.3.0, 2.2.0, 2.1.0) 
astrolabe (1.3.1) 
attr_required (1.0.1, 1.0.0) 
aws-sdk (2.6.1, 2.5.3, 2.2.16, 1.66.0, 1.64.0, 1.51.0) 
aws-sdk-core (2.6.1, 2.5.3, 2.2.16) 
aws-sdk-resources (2.6.1, 2.5.3, 2.2.16) 
aws-sdk-v1 (1.66.0, 1.64.0) 
aws-ses (0.6.0) 
axiom-types (0.1.1) 
bcrypt (3.1.11, 3.1.10, 3.1.7) 
bigdecimal (1.2.6) 
binding_of_caller (0.7.2) 
bitly (0.10.4) 
bootstrap3-datetimepicker-rails (4.7.14) 
brakeman (3.4.0, 3.1.5, 3.1.1) 
buftok (0.2.0) 
builder (3.2.2, 3.1.4) 
bullet (5.4.0, 5.0.0, 4.14.9) 
bundler (1.10.6) 
bundler-unload (1.0.2) 
byebug (9.0.5, 8.2.2, 6.0.2) 
CFPropertyList (2.3.3, 2.3.2, 2.3.1) 
chronic (0.10.2) 
climate_control (0.0.3) 
cloudfront-signer (3.0.0) 
cocaine (0.5.8, 0.5.7, 0.5.3) 
code_analyzer (0.4.7, 0.4.5) 
codeclimate-engine-rb (0.3.1) 
coercible (1.0.0) 
coffee-rails (4.2.1, 4.1.1, 4.1.0, 4.0.1) 
coffee-script (2.4.1, 2.2.0) 
coffee-script-source (1.10.0, 1.9.1.1, 1.7.0) 
colored (1.2) 
colorize (0.8.1, 0.7.7, 0.7.3, 0.5.8) 
commonjs (0.2.7) 
concord (0.1.5) 
concurrent-ruby (1.0.2, 1.0.1, 1.0.0) 
config (1.0.0) 
connection_pool (2.2.0) 
css_parser (1.2.6) 
daemons (1.2.4, 1.2.3, 1.2.2) 
dalli (2.7.6, 2.7.4) 
deadweight (0.2.2) 
debug_inspector (0.0.2) 
deep_merge (1.0.1) 
delayed_job (4.1.2, 4.1.1, 4.0.6) 
delayed_job_active_record (4.1.1, 4.1.0, 4.0.3) 
descendants_tracker (0.0.4) 
devise (4.2.0, 4.0.3, 3.5.6, 3.5.2, 3.5.1, 3.2.4) 
devise_token_auth (0.1.39) 
diff-lcs (1.2.5) 
docsplit (0.7.6, 0.7.2) 
domain_name (0.5.20160826, 0.5.25) 
encryptor (3.0.0) 
enumerable-lazy (0.0.1) 
equalizer (0.0.11, 0.0.10) 
erubis (2.7.0) 
eventmachine (1.0.8, 1.0.7) 
excel2csv (0.3.4) 
excon (0.52.0, 0.45.4, 0.45.3) 
execjs (2.7.0, 2.6.0, 2.2.0, 1.2.6) 
executable-hooks (1.3.2) 
faraday (0.9.2, 0.9.1) 
faraday_middleware (0.10.0) 
fastercsv (1.5.5) 
fb_graph (2.7.17) 
ffi (1.9.14, 1.9.10, 1.9.3) 
fission (0.5.0) 
flay (2.8.1, 2.8.0, 2.6.1, 2.4.0) 
flog (4.4.0, 4.3.2, 4.2.1) 
flowplayer-rails (0.0.3) 
fog (1.38.0, 1.34.0, 1.31.0) 
fog-aliyun (0.1.0) 
fog-atmos (0.1.0) 
fog-aws (0.11.0, 0.7.6, 0.4.0) 
fog-brightbox (0.11.0, 0.9.0, 0.7.1) 
fog-cloudatcost (0.1.2) 
fog-core (1.42.0, 1.32.1, 1.30.0) 
fog-dynect (0.0.3, 0.0.2) 
fog-ecloud (0.3.0, 0.1.2) 
fog-google (0.1.1, 0.1.0, 0.0.5) 
fog-json (1.0.2) 
fog-local (0.3.0, 0.2.1) 
fog-openstack (0.1.12) 
fog-powerdns (0.1.1) 
fog-profitbricks (2.0.1, 0.0.5, 0.0.3) 
fog-rackspace (0.1.1) 
fog-radosgw (0.0.5, 0.0.4) 
fog-riakcs (0.1.0) 
fog-sakuracloud (1.7.5, 1.3.3, 1.0.1) 
fog-serverlove (0.1.2) 
fog-softlayer (1.1.4, 0.4.7, 0.4.6) 
fog-storm_on_demand (0.1.1) 
fog-terremark (0.1.0) 
fog-vmfusion (0.1.0) 
fog-voxel (0.1.0) 
fog-vsphere (1.1.0, 1.0.1) 
fog-xenserver (0.2.3) 
fog-xml (0.1.2) 
formatador (0.2.5) 
gem-wrappers (1.2.7) 
geocoder (1.4.0, 1.2.11, 1.2.8) 
geokit (1.10.0) 
geokit-rails (2.1.0) 
globalid (0.3.7, 0.3.6, 0.3.5) 
google_currency (3.3.0, 3.2.0) 
google_timezone (0.0.5) 
grape (0.17.0, 0.13.0, 0.11.0) 
grape-entity (0.5.1, 0.4.8, 0.4.5) 
grape-swagger (0.23.0, 0.10.2, 0.7.2) 
haml (4.0.7) 
hashie (3.4.6, 3.4.4, 3.4.2) 
highline (1.7.8, 1.7.7, 1.6.21) 
hike (1.2.3) 
http (1.0.4, 0.9.8, 0.6.4) 
http-cookie (1.0.2) 
http-form_data (1.0.1) 
http_parser.rb (0.6.0) 
httparty (0.14.0, 0.13.7, 0.13.5) 
httpclient (2.8.2.4, 2.5.3.3) 
i18n (0.7.0, 0.6.9) 
ice_nine (0.11.2, 0.11.1) 
inflecto (0.0.2) 
inline_svg (0.6.2) 
io-console (0.4.3) 
ipaddress (0.8.3, 0.8.0) 
jbuilder (2.6.0, 2.4.1, 2.3.2, 2.3.1, 1.5.3) 
jmespath (1.3.1, 1.1.3) 
jquery-fileupload-rails (0.4.6, 0.4.5, 0.4.1) 
jquery-rails (4.2.1, 4.1.1, 4.1.0, 4.0.5, 3.1.4, 3.1.3, 3.1.2, 3.1.1) 
json (1.8.3, 1.8.1) 
jwt (1.5.6, 1.5.5, 1.5.4, 1.5.2, 1.5.1, 1.5.0) 
kdtree (0.3) 
kgio (2.10.0, 2.9.3) 
kramdown (1.12.0, 1.9.0, 1.7.0) 
kristin (0.4.1) 
launchy (2.4.3) 
less (2.6.0) 
less-rails (2.7.1, 2.7.0) 
libv8 (3.16.14.15 x86_64-linux, 3.16.14.13 x86_64-linux, 3.16.14.11 x86_64-linux, 3.16.14.7 x86_64-linux) 
listen (3.0.8) 
loofah (2.0.3, 2.0.2) 
mail (2.6.4, 2.6.3, 2.5.4) 
memoizable (0.4.2) 
method_source (0.8.2) 
mime-types (3.1, 3.0, 2.99, 2.6.2, 2.6.1, 1.25.1) 
mime-types-data (3.2016.0521, 3.2016.0221) 
mimemagic (0.3.2, 0.3.0) 
mini_portile (0.6.2) 
mini_portile2 (2.1.0, 2.0.0) 
minitest (5.9.0, 5.8.4, 5.8.2, 5.8.1, 5.8.0, 5.7.0, 4.7.5) 
momentjs-rails (2.10.3) 
money (6.7.1, 6.5.1) 
multi_json (1.12.1, 1.11.2, 1.11.0, 1.10.1) 
multi_xml (0.5.5) 
multipart-post (2.0.0) 
mustermann19 (0.4.4) 
mysql2 (0.4.4, 0.4.3, 0.4.2, 0.3.20, 0.3.18) 
naught (1.1.0, 1.0.0) 
nearest_time_zone (0.0.4) 
net-scp (1.2.1) 
net-ssh (3.0.1, 2.9.2) 
net-ssh-gateway (1.2.0) 
netrc (0.11.0) 
nio4r (1.2.1) 
nokogiri (1.6.8, 1.6.7.2, 1.6.6.2) 
noti (1.0.2) 
notifyor (0.8.1) 
oa-core (0.3.2) 
oauth (0.5.1, 0.4.7) 
oauth2 (1.2.0, 1.0.0) 
omniauth (1.3.1, 1.2.2) 
omniauth-facebook (4.0.0, 2.0.1) 
omniauth-google-oauth2 (0.4.1, 0.2.8, 0.2.6) 
omniauth-linkedin-oauth2 (0.1.5) 
omniauth-oauth2 (1.4.0, 1.3.1, 1.3.0) 
omniauth-stripe-connect (2.9.0) 
options (2.3.2) 
orm_adapter (0.5.0) 
paperclip (5.1.0, 4.3.5, 4.2.2) 
parse-ruby-client (0.3.0) 
parser (2.3.1.2, 2.3.0.6, 2.2.3.0) 
path_expander (1.0.0) 
pdf2html (0.1.0) 
pkg-config (1.1.7) 
polyglot (0.3.5) 
posix-spawn (0.3.11) 
powerpack (0.1.1) 
pr_geohash (1.0.0) 
private_attr (1.1.0) 
procto (0.0.2) 
progress_bar (1.0.5, 1.0.3) 
protected_attributes (1.1.3, 1.0.9) 
protected_attributes_continued (1.2.2) 
psych (2.1.1, 2.0.15, 2.0.13, 2.0.8) 
puma (3.6.0) 
rack (2.0.1, 1.6.4, 1.6.1, 1.5.5, 1.5.2) 
rack-accept (0.4.5) 
rack-mini-profiler (0.9.7) 
rack-mount (0.8.3) 
rack-oauth2 (1.4.0, 1.2.1, 1.1.1) 
rack-protection (1.5.3) 
rack-test (0.6.3, 0.6.2) 
rails (5.0.0.1, 5.0.0, 4.2.4, 4.2.2, 4.2.0, 4.0.2) 
rails-deprecated_sanitizer (1.0.3) 
rails-dom-testing (2.0.1, 1.0.7, 1.0.6) 
rails-html-sanitizer (1.0.3, 1.0.2) 
rails_best_practices (1.17.0, 1.15.7) 
rails_config (0.99.0) 
railties (5.0.0.1, 5.0.0, 4.2.4, 4.2.2, 4.2.0, 4.0.2) 
rainbow (2.1.0, 2.0.0) 
raindrops (0.17.0, 0.16.0, 0.15.0, 0.13.0) 
rake (11.2.2, 11.1.2, 10.5.0, 10.4.2, 10.3.2) 
rb-fsevent (0.9.7) 
rb-inotify (0.9.7) 
rbvmomi (1.8.2) 
rdoc (4.2.2, 4.2.0) 
redis (3.3.0) 
reek (4.4.1, 4.1.0, 3.10.1, 1.6.5) 
ref (2.0.0, 1.0.5) 
remotipart (1.3.0, 1.2.1) 
require_all (1.3.3, 1.3.2) 
responders (2.3.0, 2.1.2, 2.1.1, 2.1.0, 1.1.2) 
responds_to_parent (1.1.0) 
rest-client (2.0.0, 1.8.0) 
roo (2.5.1, 2.3.1, 1.13.2) 
rsolr (1.1.2, 1.1.1, 1.0.13, 1.0.12) 
rubocop (0.43.0, 0.42.0, 0.37.2, 0.34.2) 
ruby-ole (1.2.12, 1.2.11.8) 
ruby-progressbar (1.8.1, 1.7.5) 
ruby2ruby (2.2.0) 
ruby_parser (3.8.2, 3.7.3, 3.7.1) 
rubycritic (2.9.4, 2.9.3, 2.7.1, 1.4.0) 
rubygems-bundler (1.4.4) 
rubyzip (1.2.0, 1.1.7) 
rvm (1.11.3.9) 
s3_direct_upload (0.1.7) 
safe_yaml (1.0.4) 
sass (3.4.22, 3.4.21, 3.4.19, 3.4.18, 3.4.14, 3.2.19) 
sass-rails (5.0.6, 5.0.4, 5.0.3, 4.0.5) 
sdoc (0.4.1) 
sexp_processor (4.7.0, 4.6.1, 4.6.0) 
simple_calendar (2.1.0) 
simple_form (3.3.1, 3.2.1, 3.2.0, 3.1.1, 3.1.0) 
simple_oauth (0.3.1) 
sinatra (1.4.6) 
sixarm_ruby_unaccent (1.1.1) 
slim (3.0.6) 
spoon (0.0.4) 
spreadsheet (1.1.3, 1.1.1, 1.0.7, 1.0.3, 0.9.0) 
spring (1.7.2, 1.6.4, 1.6.3, 1.4.0, 1.3.6) 
spring-watcher-listen (2.0.0) 
sprockets (3.7.0, 3.6.3, 3.5.2, 3.4.0, 3.3.5, 3.3.4, 3.2.0, 2.12.4) 
sprockets-rails (3.2.0, 3.0.4, 3.0.1, 2.3.3, 2.3.1, 2.0.1) 
sqlite3 (1.3.11) 
streamio-ffmpeg (3.0.0, 1.0.0) 
stripe (1.55.0, 1.54.0, 1.31.0) 
sunspot (2.2.6, 2.2.5, 2.2.0, 2.1.0) 
sunspot_rails (2.2.6, 2.2.5, 2.2.0, 2.1.0) 
sunspot_solr (2.2.6, 2.2.5, 2.2.0, 2.1.0) 
temple (0.7.6) 
terminal-notifier (1.6.3) 
terminal-table (1.5.2) 
therubyracer (0.12.2) 
thin (1.6.4, 1.6.3) 
thor (0.19.1) 
thread_safe (0.3.5, 0.3.4) 
tilt (2.0.5, 2.0.2, 2.0.1, 1.4.1) 
timezone (0.99.2) 
traceroute (0.5.0) 
treetop (1.4.15) 
trollop (2.1.2) 
turbolinks (5.0.1, 2.5.3) 
turbolinks-source (5.0.0) 
twilio-ruby (4.6.1) 
twitter (5.16.0, 5.15.0, 5.14.0) 
twitter-bootstrap-rails (3.2.0) 
twitter_oauth (0.4.94) 
tzinfo (1.2.2, 0.3.44, 0.3.39) 
uglifier (3.0.2, 3.0.0, 2.7.2, 2.7.1) 
unf (0.1.4) 
unf_ext (0.0.7.2, 0.0.7.1) 
unicode-display_width (1.1.1, 0.3.1) 
unicorn (5.1.0, 5.0.1, 4.9.0, 4.1.1) 
uniform_notifier (1.10.0, 1.9.0) 
unparser (0.2.4) 
virtus (1.0.5) 
warden (1.2.6, 1.2.3) 
web-console (3.3.1, 2.3.0, 2.2.1) 
websocket-driver (0.6.4) 
websocket-extensions (0.1.2) 
whenever (0.9.4) 
wicked_pdf (1.1.0, 1.0.3, 0.11.0) 
wkhtmltopdf-binary (0.12.3, 0.9.9.3) 
xml-simple (1.1.5) 

请帮我删除此DEPRECATION WARNING

+0

你试过'宝石'设计','〜> 4.2''吗? – Sebastian

+0

是的。但仍然存在同样的问题。 –

+0

这些是你使用的唯一宝石吗?我试着用'devise(4.2.0)'和'devise_token_auth(0.1.39)'引导服务器,我没有得到弃用警告。 [devise]的主版本中没有任何'alias_method_chain'调用(https://github.com/plataformatec/devise/search?utf8=%E2%9C%93&q=alias_method_chain)和[devise_token_auth](https: //github.com/lynndylanhurley/devise_token_auth/search?utf8=%E2%9C%93&q=alias_method_chain)。 – Sebastian

回答

2

该问题是由fb_graph宝石造成的。他们提到这个宝石is deprecated,你应该使用fb_graph2。除非您使用deprecated功能,否则应该切换。

gem 'fb_graph2' 

更换

gem 'fb_graph' 

使得当你启动服务器的废弃警告消失。

+0

谢谢。它的工作正常。 –