0
每當我嘗試運行服務器時,我都會收到此錯誤,不確定它是否與js運行時相關,我正在使用爲此安裝的節點和execjs。Rails Bundler :: GemRequireError啓動服務器時
/Users/me/.rvm/gems/[email protected]/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 /Users/me/.rvm/gems/[email protected]/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/me/.rvm/gems/[email protected]/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /Users/me/.rvm/gems/[email protected]/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /Users/me/.rvm/gems/[email protected]/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /Users/me/.rvm/gems/[email protected]/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /Users/me/.rvm/gems/[email protected]/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /Users/me/Documents/Rails/Paid/paid-api/config/application.rb:17:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/railties-5.0.0.beta3/lib/rails/commands/commands_tasks.rb:88:in `require'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/railties-5.0.0.beta3/lib/rails/commands/commands_tasks.rb:88:in `block in server'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/railties-5.0.0.beta3/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/railties-5.0.0.beta3/lib/rails/commands/commands_tasks.rb:85:in `server'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/railties-5.0.0.beta3/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/railties-5.0.0.beta3/lib/rails/command.rb:20:in `run'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/railties-5.0.0.beta3/lib/rails/commands.rb:18:in `<top (required)>'
from /Users/me/Documents/Rails/Paid/paid-api/bin/rails:9:in `require'
from /Users/me/Documents/Rails/Paid/paid-api/bin/rails:9:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `load'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `call'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/spring-1.6.4/lib/spring/client/command.rb:7:in `call'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/spring-1.6.4/lib/spring/client.rb:28:in `run'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/spring-1.6.4/bin/spring:49:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `load'
from /Users/me/.rvm/gems/ruby-2.2.2/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/me/Documents/Rails/Paid/paid-api/bin/spring:13:in `require'
from /Users/me/Documents/Rails/Paid/paid-api/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', '>= 5.0.0.beta2', '< 5.1'
gem 'rails-api'
# Concurrent app server
gem 'puma'
gem 'activerecord-import', '~> 0.11.0'
# Message Queuing
gem 'aws-sdk', '~> 2'
# Load Balancing
gem 'shoryuken'
# Salesforce REST api
gem 'restforce'
# PAID ruby-gem
gem 'paid'
group :development, :test do
gem 'rubocop', '~> 0.39.0', require: false
end
group :development do
gem 'spring'
end
group :test do
gem 'rspec-core'
end
group :doc do
gem 'sdoc'
end
我的application.rb中的文件,沒有太大的不同:
require File.expand_path('../boot', __FILE__)
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/engine"
# require "sprockets/railtie"
require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module PaidApi
class Application < Rails::Application
config.active_job.queue_adapter = :shoryuken
end
end
它的工作,非常感謝! – whatAboutJohn