Rails gem路径错误

时间:2017-07-26 11:09:00

标签: ruby-on-rails rubygems

我有一个rails应用程序,我正在安装宝石,它工作正常。 现在,我不知道我做了什么,当我在Gemfile中添加一个gem并运行bundle install时,应用程序崩溃了Gem not found错误(例如:“我们很抱歉,但出了点问题。...在任何来源(Bundler :: GemNotFound)中找不到gmaps4rails-2.1.2 ......“)。

我尝试了这个命令: 哪个宝石gmaps4rails 输出:/ usr / bin / gem

乘客错误显示:     系统信息

Ruby interpreter command
/home/webmaster/.rbenv/versions/2.3.3/bin/ruby

User and groups
uid=1001(webmaster) gid=33(www-data) groups=33(www-data),27(sudo),110(lxd)

Environment variables

APACHE_RUN_DIR = /var/run/apache2
APACHE_PID_FILE = /var/run/apache2/apache2.pid
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
APACHE_LOCK_DIR = /var/lock/apache2
LANG = C
APACHE_RUN_USER = www-data
APACHE_RUN_GROUP = www-data
APACHE_LOG_DIR = /var/log/apache2
PWD = /var/www/maus_view
PASSENGER_USE_FEEDBACK_FD = true
SERVER_SOFTWARE = Apache/2.4.18 (Ubuntu) Phusion_Passenger/5.1.5
PASSENGER_DEBUG_DIR = /tmp/passenger.spawn-debug.XXXXIfqFGX
USER = webmaster
LOGNAME = webmaster
SHELL = 
HOME = /home/webmaster
IN_PASSENGER = 1
PYTHONUNBUFFERED = 1
NODE_PATH = /usr/share/passenger/node
RAILS_ENV = development
RACK_ENV = development
WSGI_ENV = development
NODE_ENV = development
PASSENGER_APP_ENV = development
BUNDLER_ORIG_PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GEM_PATH = /home/webmaster/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0:/home/webmaster/.gem/ruby/2.3.0
GEM_HOME = /home/webmaster/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0

我已经阅读了很多stackoverflow的帖子,但我无法调试并找到解决此问题的方法。

有人能帮助我吗?

谢谢

---编辑---

这是我的 Gemfile:

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.0.2'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.3.18', '< 0.5'
# 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', '>= 3.3.0'
  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]

gem 'devise'
#gem 'gmaps4rails'

1 个答案:

答案 0 :(得分:2)

对于某些宝石,您需要通过命令行安装它们,而不仅仅是“捆绑安装”它们。 所以试试跑:

gem install gmaps4rails

转到项目目录并点击bundle install

希望它有所帮助!