Questions tagged [gemfile]

Gemfile - A format for describing gem dependencies for Ruby programs. A Gemfile describes the gem dependencies required to execute associated Ruby code.

Gemfiles are a format for describing what gems are required by a Ruby program in order to successfully run.

See also

712 questions
14
votes
4 answers

Bundler: always use latest revision of git branch in Gemfile

I have a Gemfile with a private git repo in the following format: gem 'magic_beans', :git => "git@git.example.com:magic_beans.git', :branch => 'super_beans' When I bundle install, the Gemfile.lock locks it to a specific SHA revision. Can I get…
pithyless
  • 1,659
  • 2
  • 16
  • 31
14
votes
4 answers

How can Bundler/Gemfile be configured to use different gem sources during development?

I have a Sinatra application that requires another gem I'm developing locally. I'm having trouble configuring Bundler to use my local gem code during development but my vendored gem code in production. Ideally I could do something like this, but…
Kyle Fox
  • 3,133
  • 4
  • 23
  • 26
14
votes
10 answers

rails 5.0.0 when installing "nio4r" : Failed to build gem native extension

Here is the logs: http://pastebin.com/CAgur9xd Installing nio4r 1.2.1 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. C:/RailsInstaller/Ruby2.2.0/bin/ruby.exe -r ./siteconf20160720-8272-c88sgk.rb…
Mfms99
  • 143
  • 1
  • 1
  • 7
13
votes
3 answers

Local Gem Path For Development And Remote Git Repo For Production

I have a gem I'm working on locally which is used by a project. If I specify the gem's location using path in the , I can make a change and the project picks up the fresh code: gem 'example', :path => "~/path/to/gems/example" However, when I push…
Undistraction
  • 42,754
  • 56
  • 195
  • 331
13
votes
4 answers

How to find unused gems and cleanup gemfile

I'm looking for simple, but good way to cleanup gemfile and make rails startup faster. How can I get a list of all required gems vs all loaded gems.
Seva Feldman
  • 143
  • 1
  • 1
  • 5
13
votes
1 answer

How do i use a dependency from github in my gemspec?

I currently have the following in my Gemfile: gem 'voteable_mongo'#, :github => 'kamilski81/voteable_mongo' and I migrating my models into a .gemspec, but i'm not sure how this would look inside my gemspec. I currently have: s.add_dependency…
Kamilski81
  • 14,409
  • 33
  • 108
  • 161
13
votes
2 answers

Why is 'jQuery-Rails' often outside of the asset group

Why is it that I often see gem 'jquery-rails outside of the :assets group? group :assets do gem 'sass-rails', " ~> 3.1.0" gem 'coffee-rails', " ~> 3.1.0" gem 'uglifier' end gem 'jquery-rails' Will there be buggy behavior if I put it…
mazlix
  • 6,003
  • 6
  • 33
  • 45
12
votes
4 answers

When do you need a require in a rails Gemfile?

In my gemfile I have things like: gem 'net-sftp', '2.1.1', :require => 'net/sftp' gem 'backup', '3.0.27' gem 'watu_table_builder', :require => 'table_builder' gem 'browser', '0.1.6' When in a Gemfile do you need a require? I've also found things…
kddeisz
  • 5,162
  • 3
  • 21
  • 44
12
votes
2 answers

How do i get IntelliJ to pick up my environment variables on MacOS X?

I have tried to set these using RCenvironment, .bashrc, .MacOSX/environment.plist and /etc/launchd.conf and restarted computer....IntelliJ is still not picking up my env variables: Gemfile p "ENVIRONMENT: #{ENV['VAR_PRIVATE_GEM_USERNAME']}" #…
Kamilski81
  • 14,409
  • 33
  • 108
  • 161
11
votes
3 answers

(Rails 5) LoadError: cannot load such file -- sass ...when deploying to Heroku

I'm getting the error in the title when I deploy my Rails 5 app. I recently updated my Gemfile to include some more recent versions. I don't have any issues on my local development environment but when I push to Heroku, which is in "production mode"…
emersonthis
  • 32,822
  • 59
  • 210
  • 375
11
votes
1 answer

How to specify source in .gemspec file?

I'm building a gem that uses rails-assets-growl gem. This gem can be added to my Gemfile using a different source than 'https://rubygems.org' like this: source 'https://rails-assets.org' do gem 'rails-assets-growl' end This works fine in…
Leantraxxx
  • 4,506
  • 3
  • 38
  • 56
10
votes
2 answers

Error loading the 'postgresql' Active Record adapter. Missing a gem it depends on? pg is not part of the bundle. Add it to your Gemfile

Gemfile source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } Ruby '2.3.3' gem 'rails', '~> 5.2.1' gem 'bootstrap-sass', '3.3.7' gem 'puma', '~> 3.11' gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' gem…
Geetha B
  • 101
  • 1
  • 3
10
votes
2 answers

When trying to upgrade to Rails 5, getting "Bundler could not find compatible versions for gem "railties"" error

I’m trying to upgrade to Rails 5. I deleted my Gemfile.lock file, edited my Gemfile to look like below source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '5.0.0' # Use sqlite3 as the…
user6447029
10
votes
5 answers

I can't run "bundle update" because of "mysql2" gem

I have this in the Gemfile: gem 'mysql2' But when I run bundle update, I get this error message: An error occurred while installing mysql2 (0.3.16), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.3.16'` succeeds before…
user984621
  • 46,344
  • 73
  • 224
  • 412
10
votes
2 answers

In a ruby .gemspec file, how do I specify multiple versions of a dependency?

I'm trying to modify a gem which currently has a dependency on activeresource defined as: s.add_dependency "activeresource", "~> 3.0" In order to get the gem working with Rails 4, I need to extend the dependency to work with either…
Simmo
  • 1,717
  • 19
  • 37