我正在尝试在Rails beta3上测试我的应用。当我尝试在rails服务器上运行应用程序时,我收到以下错误(使用stacktrace)
/home/sambhav/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'rails-api'. (Bundler::GemRequireError)
from /home/sambhav/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/sambhav/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /home/sambhav/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /home/sambhav/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /home/sambhav/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /home/sambhav/.rvm/gems/ruby-2.3.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /home/sambhav/caroobi/caroobi/config/application.rb:7:in `<top (required)>'
from /home/sambhav/caroobi/caroobi/vendor/cache/bundler/gems/rails-cf1d45bd8930/railties/lib/rails/commands/commands_tasks.rb:88:in `require'
from /home/sambhav/caroobi/caroobi/vendor/cache/bundler/gems/rails-cf1d45bd8930/railties/lib/rails/commands/commands_tasks.rb:88:in `block in server'
from /home/sambhav/caroobi/caroobi/vendor/cache/bundler/gems/rails-cf1d45bd8930/railties/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/sambhav/caroobi/caroobi/vendor/cache/bundler/gems/rails-cf1d45bd8930/railties/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/sambhav/caroobi/caroobi/vendor/cache/bundler/gems/rails-cf1d45bd8930/railties/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/sambhav/caroobi/caroobi/vendor/cache/bundler/gems/rails-cf1d45bd8930/railties/lib/rails/command.rb:20:in `run'
from /home/sambhav/caroobi/caroobi/vendor/cache/bundler/gems/rails-cf1d45bd8930/railties/lib/rails/commands.rb:18:in `<top (required)>'
from /home/sambhav/caroobi/caroobi/bin/rails:9:in `require'
from /home/sambhav/caroobi/caroobi/bin/rails:9:in `<top (required)>'
from /home/sambhav/caroobi/caroobi/vendor/cache/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `load'
from /home/sambhav/caroobi/caroobi/vendor/cache/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `call'
from /home/sambhav/caroobi/caroobi/vendor/cache/gems/spring-1.6.4/lib/spring/client/command.rb:7:in `call'
from /home/sambhav/caroobi/caroobi/vendor/cache/gems/spring-1.6.4/lib/spring/client.rb:28:in `run'
from /home/sambhav/caroobi/caroobi/vendor/cache/gems/spring-1.6.4/bin/spring:49:in `<top (required)>'
from /home/sambhav/caroobi/caroobi/vendor/cache/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `load'
from /home/sambhav/caroobi/caroobi/vendor/cache/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/sambhav/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/sambhav/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/sambhav/caroobi/caroobi/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
的Gemfile
source 'https://rubygems.org'
gem 'rails', github: "rails/rails"
gem 'sass-rails', '~> 5.0'
gem 'mysql2', '0.3.18'
gem 'uglifier', '>= 1.3.0'
gem 'geoip', '1.4.0'
gem 'sanitize', '3.0.0'
gem 'i18n-js', '2.1.2'
gem 'bootstrap-sass', '3.2.0.1' # Bootstrap in SCSS
gem 'exception_notification', '4.0.1'
gem 'rake', '10.3.2'
gem 'newrelic_rpm', '~> 3.14', '>= 3.14.2.312'
gem 'active_model_serializers', '0.9.4'
gem 'rails-api', '0.4.0'
gem 'prerender_rails'
gem 'i18n-docs'
group :development, :test do
gem 'pry'
gem 'spring'
gem 'annotator', require: false
gem 'letter_opener'
gem 'rspec-rails'
gem 'rack-cors'
gem 'sqlite3'
end
注意:我已经安装了NodeJS作为一些建议的帖子。 Ruby版本:2.3.0
我还能尝试其他什么?
答案 0 :(得分:3)
如果你正在使用Rails 5,请不要包含gem rails-api(已经包含在Rails 5中)。