Ruby on rails Rails无法将新的gem部署到生产环境中

Ruby on rails Rails无法将新的gem部署到生产环境中,ruby-on-rails,ruby,nginx,activeadmin,Ruby On Rails,Ruby,Nginx,Activeadmin,因此,尽管如此,我一直在部署我的web应用程序,却不知道它是否已投入生产。 我通常会像往常一样创建我的项目,在那里我只需要安装基本的捆绑包。并添加新的宝石 然后当我查看aws的公共dns时,它会显示我的站点,就像我在localhost:3000上看到的一样 在我看来,我仍然处于开发环境中。然而,当我安装一个新的gem时,它似乎只在localhost:3000上工作,但在部署的站点上它本身是无法识别的。例如ActiveAdmin gem,在我的站点上显示“未初始化常量ActiveAdmin” 我应

因此,尽管如此,我一直在部署我的web应用程序,却不知道它是否已投入生产。 我通常会像往常一样创建我的项目,在那里我只需要安装基本的捆绑包。并添加新的宝石

然后当我查看aws的公共dns时,它会显示我的站点,就像我在localhost:3000上看到的一样

在我看来,我仍然处于开发环境中。然而,当我安装一个新的gem时,它似乎只在localhost:3000上工作,但在部署的站点上它本身是无法识别的。例如ActiveAdmin gem,在我的站点上显示“未初始化常量ActiveAdmin”

我应该如何解决这个问题?我怀疑这可能是因为不同的环境,但我不确定如何处理这个问题

更新我的gem文件

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end


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

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# 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
#gem 'pdf-reader'
gem 'pdf-reader-turtletext'
gem 'nokogiri'
gem 'whenever', :require => false
gem 'unicorn'
gem 'devise'
#gem 'rails_admin', '~> 1.1.1'
gem 'activeadmin', github: 'activeadmin'
gem 'inherited_resources', github: 'activeadmin/inherited_resources'

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # 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]
源代码'https://rubygems.org'
git_源(:github)do | repo_名称|
repo_name=“#{repo_name}/#{repo_name}”除非repo_name.include?(“/”)
"https://github.com/#{repo_name}.git“
结束
#捆绑边缘Rails:gem'Rails',github'Rails/Rails'
gem'rails',“~>5.1.1”
#使用sqlite3作为活动记录的数据库
gem'sqlite3'
#使用Puma作为应用程序服务器
宝石“彪马”,“大于3.7”
#将SCS用于样式表
gem'sass-rails',“~>5.0”
#使用Uglifier作为JavaScript资产的压缩器
gem'uglifier','>=1.3.0'
#看https://github.com/rails/execjs#readme 获取更多受支持的运行时
宝石“therubyracer”,平台::ruby
#将CoffeeScript用于.coffee资产和视图
gem“咖啡轨”,“~>4.2”
#Turbolinks使web应用程序的导航速度更快。阅读更多:https://github.com/turbolinks/turbolinks
gem“涡轮链接”,“大于5”
#轻松构建JSON API。阅读更多:https://github.com/rails/jbuilder
gem'jbuilder',“~>2.5”
#使用Redis适配器在生产中运行操作电缆
#gem'redis',“~>3.0”
#使用ActiveModel具有\u安全\u密码
#gem'bcrypt',“~>3.1.7”
#使用Capistrano进行部署
#gem“capistrano rails”,集团::开发
#创业板“pdf阅读器”
gem“pdf阅读器turtletext”
宝石“nokogiri”
gem'where',:require=>false
宝石“独角兽”
宝石“设计”
#gem'rails_admin',“~>1.1.1”
gem'activeadmin',github'activeadmin'
gem'inherited_resources',github:'activeadmin/inherited_resources'
小组:开发,:测试
#在代码中的任意位置调用“byebug”以停止执行并获得调试器控制台
gem'byebug',平台:[:mri,:mingw,:x64_mingw]
#增加了对Capybara系统测试和selenium驱动程序的支持
宝石“水豚”,“大于2.13”
gem“selenium webdriver”
结束
小组:发展怎么办
#在异常页面上或通过使用代码中的任意位置访问IRB控制台。
gem“web控制台”,“>=3.3.0”
gem'listen','>=3.0.5','<3.2'
#Spring通过让应用程序在后台运行来加速开发。阅读更多:https://github.com/rails/spring
宝石“春天”
gem‘SpringWatcherListen’,“~>2.0.0”
结束
#Windows不包括zoneinfo文件,因此捆绑tzinfo数据
gem'tzinfo data',平台:[:mingw,:mswin,:x64_mingw,:jruby]

请发布您的GEM文件。您是如何部署的?您的
Gemfile
(特别是包含
活动\u admin
的部分)是什么?您的部署是否正在运行
bundle install
并重新启动
unicorn
服务器?我的“部署”基本上就是我根据上面的链接安装nginx和unicorn。我不确定如何重新启动我的unicorn服务器。。。sudo service restart unicorn等示例不起作用。可能是因为它本身不包含任何gem,请尝试。也在数字海洋上。通常情况下,
服务nginx重启
足以重新加载env。我怀疑这是我的unicorn安装问题。我刚刚通过项目重新设置了nginx和unicorn。还有沃莉亚!它起作用了!如果你们知道发生了什么,告诉我。