0
votes

After I installed gem grape-jbuilder
and run bundle exec rails s it showed this message


bin/rails:6: warning: already initialized constant APP_PATH            
/Users/xxx/xxx/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:   
 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.         

And when I run bundle exec rake rails:update:bin It show the error message below


rake aborted!
LoadError: cannot load such file -- hashie/hash
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in require'
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:inblock in require'
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in load_dependency'
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:inrequire'
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/grape-jbuilder-0.2.0/lib/grape/jbuilder.rb:2:in <top (required)>'
/Users/xxx/xxx/config/application.rb:7:in'
/Users/xxx/xxx/Rakefile:4:in require'
/Users/xxx/xxx/Rakefile:4:in'
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in <top (required)>'
/Users/xxx/.rbenv/versions/2.3.1/bin/bundle:23:inload'
/Users/xxx/.rbenv/versions/2.3.1/bin/bundle:23:in <main>'
LoadError: cannot load such file -- grape-jbuilder
/Users/xxx/xxx/config/application.rb:7:in'
/Users/xxx/xxx/Rakefile:4:in require'
/Users/xxx/xxx/Rakefile:4:in'
/Users/xxx/xxx/vendor/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in <top (required)>'
/Users/xxx/.rbenv/versions/2.3.1/bin/bundle:23:inload'
/Users/jiaping/.rbenv/versions/2.3.1/bin/bundle:23:in `'
(See full trace by running task with --trace)

Gemfile


gem 'rails', '4.2.4'
gem 'rack-contrib'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'therubyracer'
gem 'rb-readline'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'bootstrap-sass'
gem 'font-awesome-rails'
gem 'react-rails'
gem 'coffee-rails', '~> 4.1.0'
gem 'uglifier', '>= 1.3.0'
gem 'sass-rails'
gem 'momentjs-rails'
gem 'bootstrap3-datetimepicker-rails'
gem 'jquery-payment-rails', git: 'https://github.com/thoughtbot/jquery-payment-rails.git'
gem 'page_title_helper'
gem 'sprockets-es6', require: 'sprockets/es6'
gem 'jbuilder', '~> 2.0'
gem 'sorcery'
gem 'oauth2', '~> 1.3.0'
gem 'bcrypt'
gem 'dotenv-rails'
gem 'config', '~> 1.0.0'
gem 'enum_help'
gem 'mysql2', '~> 0.3.18'
gem 'squeel'
gem 'seed-fu'
gem 'carrierwave'
gem 'carrierwave-data-uri'
gem 'carrierwave-aws'
gem 'rmagick'
gem 'acts_as_list'
gem 'kaminari'
gem 'ransack'
gem 'rails-jquery-autocomplete'
gem 'gretel'
gem 'email_validator'
gem 'icalendar'
gem 'bootstrap_form'
gem 'paranoia', '~> 2.0'
gem 'unicorn'
gem 'unicorn-rails'
gem 'unicorn-worker-killer'
gem 'google-analytics-rails'
gem 'meta-tags'
gem 'web-console', '~> 2.0', group: :development
gem 'adminlte2-rails'
gem 'geocoder'
gem 'validates_timeliness', '~> 4.0'
gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby'
gem 'whenever', require: false
gem 'holiday_jp'
gem 'exception_notification', github: 'smartinez87/exception_notification'
gem 'slack-notifier'
gem 'grape'
gem 'grape-jbuilder'

group :staging do gem 'letter_opener_web' end group :development, :test do gem 'letter_opener' gem 'spring' gem 'spring-commands-rspec' gem 'rspec-rails' gem 'factory_girl_rails' gem 'simplecov', require: false gem 'rubocop' gem 'byebug' gem 'better_errors' gem 'pry' gem 'pry-byebug' gem 'pry-doc' gem 'pry-rails' gem 'pry-stack_explorer' gem 'quiet_assets' gem 'awesome_print' gem 'annotate' gem 'migration_comments' gem 'capistrano', '~> 3.4.0' gem 'capistrano-rails' gem 'capistrano-rbenv' gem 'capistrano-bundler' gem 'capistrano3-unicorn' gem 'rails-admin-scaffold' end

group :test do gem 'capybara' gem 'database_cleaner' gem 'faker' gem 'fuubar' gem 'launchy' gem 'selenium-webdriver' gem 'shoulda-matchers' gem 'timecop' end

How can I solve this problem?

1

1 Answers

0
votes

From here:

Actually it's spring which cause this issue. Try to comment it in the Gemfile, then bundle install and restart the server ; shutting it down, the warning is not present anymore.