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
35
votes
9 answers

Rails: Your user account isn't allowed to install to the system RubyGems

I am running the command bundle install in a project folder. In some project folders it will produce an error and in other projects folders it will not produce an error. The error is: Your user account isn't allowed to install to the system…
William Entriken
  • 37,208
  • 23
  • 149
  • 195
34
votes
1 answer

What is the difference between "~> 4.0.1", "4.0.1" and no version specifier in a Gemfile?

In Rails Gemfile, what are the differences between these : gem "gemname", "~> 4.0.1" and gem "gemname", "4.0.1" and gem "gemname" Also what should be used where and benefit of following that way?
JVK
  • 3,782
  • 8
  • 43
  • 67
33
votes
4 answers

Where is the "Gemfile" in Ruby?

I often see in documentation on the Internet, "put this in the Gemfile". I don't know where and what this "Gemfile" is. If I install a gem then I have installed it. Who need than a "Gemfile"? Where or what is the Gemfile, and why is it used?
GluecklichesHuhn
  • 331
  • 1
  • 3
  • 3
30
votes
4 answers

Ruby Bundler multiple sources in Gemfile

I need to ensure some of my gems are installed from our own gem repository rather than rubygems, while the rest are installed from rubygems. Can I set this up in the Gemfile without worrying about a naming conflict with a identically named gem in…
mawk044
  • 493
  • 2
  • 5
  • 7
29
votes
2 answers

Difference between gem and require (require open-uri)

I just wanted to understand for my self. I'm using the nokogiri gem (for parsing HTML). If I got it right to open URLs I need to use a method from the gem 'open-uri'. But when I include it in my Gemfile (on Windows developer's machine): gem…
WHITECOLOR
  • 24,996
  • 37
  • 121
  • 181
28
votes
1 answer

How to deal with bundler updates (Gemfile.lock) in collaborative context?

I have been a lone programmer on a particular project, but now someone else has joined as collaborator. With just me in the picture, bundler updates have been smooth, and I never thought twice about Gemfile.lock being tracked by Git. The new…
user664833
  • 18,397
  • 19
  • 91
  • 140
27
votes
2 answers

How can I resolve "Your bundle only supports platforms ["x86-mingw32"] but your local platforms are ["ruby", "x86_64-linux"]"

I'm building a rails site on a Windows machine but when I check in my Gemfile.lock I get the following error on my Travis builds: Your bundle only supports platforms ["x86-mingw32"] but your local platforms are ["ruby", "x86_64-linux"], and there's…
Godwin
  • 9,739
  • 6
  • 40
  • 58
27
votes
3 answers

Does the order of gems in your Gemfile make a difference?

Is the order in which you list your gems important? Are these two blocks equivalent? gem 'carrierwave' gem 'rmagick' And gem 'rmagick' gem 'carrierwave'
dee
  • 1,848
  • 1
  • 22
  • 34
26
votes
3 answers

An error occurred while installing debugger-linecache (1.1.1), and Bundler cannot continue

Any idea how to fix this? Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /home/durrantm/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb checking for vm_core.h... no checking for vm_core.h... no Makefile creation…
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
25
votes
4 answers

Is It A Bad Practice to List Ruby Version in Both Gemfile and .ruby-version Dotfile?

My latest Rails project is more or less and experiment for me to break lots of things and learn in the process. I have the latest version of Ruby specified in my gemfile: ruby '2.2.3' And I also have a .ruby-version dotfile in the project, with the…
Todd
  • 2,824
  • 2
  • 29
  • 39
24
votes
2 answers

Gemfile.lock Use in Rails?

What is the purpose of "Gemfile.lock" in Rails? I have been searching around for but could not find a satisfactory answer.
Nitish Upreti
  • 6,312
  • 9
  • 50
  • 92
24
votes
2 answers

Set ruby version in Gemfile

I can set ruby version in Gemfile as follows: ruby '2.0.0' But what if I want to have a particular version as 2.0.0-p353? When I add it to Gemfile, I get: Your Ruby version is 2.0.0, but your `Gemfile` specified 2.0.0-p353 Is it even possible to…
Alex Smolov
  • 1,831
  • 4
  • 24
  • 43
24
votes
2 answers

Bundler cannot find a version of a gem, but gem install with the same name works

I've created a gem, and for some reason this one keeps bugging me, and refuses to install properly through bundler. Here's the Gemfile: source 'https://rubygems.org' gem 'rails', '3.2.9' gem "switch_access-rails", "~> 1.1.6" bundle install fails…
leifcr
  • 1,458
  • 11
  • 15
23
votes
1 answer

already activated spring 1.4.0, but Gemfile requires spring 1.3.3[error]

My server is running fine but when I try to enter console by rails c, I got the following error. /home/munam/.rvm/gems/ruby-2.2.0@jugojuice/gems/bundler-1.10.6/lib/bundler/runtime.rb:34:in `block in setup': You have already activated spring 1.4.0,…
techdreams
  • 5,371
  • 7
  • 42
  • 63
23
votes
6 answers

What can I do about a Bundler::GemfileNotFound error?

I just installed bundler-1.3.3 successfully. However, when I try to run bundle install I get Bundler::GemfileNotFound What is wrong here?
user1420042
  • 1,689
  • 9
  • 35
  • 53
1
2
3
47 48