gemfile

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

▼魔方 西西 提交于 2019-11-29 06:06:45
问题 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 following contents: 2.2.3 Other than the obvious duplication, what is wrong with this? What is the purpose of both conventions? If I should only have one convention for listing my Ruby version, why should I have one (Gemfile) over the other

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

江枫思渺然 提交于 2019-11-29 05:59:04
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 Bundler doesn't allow you to specify the same gem twice: # Doesn't work: group :development do gem 'awesome', :path => "~/code/awesome" end group :production do gem 'awesome', :path => "vendor/gems/awesome-0.0.1" end In the meantime I've resorted to manually vendoring the gem & updating the gem source in the Gemfile every single time I deploy, which is

Troubles with git and Gemfile.lock

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 02:13:06
问题 I keep running into the following error with my Gemfile.lock whenever I want to do a git pull or checkout a new branch. error: Your local changes to the following files would be overwritten by merge: Gemfile.lock Please, commit your changes or stash them before you can merge. Aborting The problem is that I can't figure out how to fix it. Stashing the file doesn't work -- the local changes just stay there for some reason. I've also tried running git checkout -- Gemfile.lock to discard the

Ruby Bundler multiple sources in Gemfile

陌路散爱 提交于 2019-11-28 22:37:33
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 Rubygems? How Can I determine where the gem is downloaded from? eg Gemfile: source :rubygems gem 'gemfromrubygems1' gem 'gemfromrubygems2' source "http://our.own.gem.repo.com/the/path/to/it" gem 'gemfromourrepo' Bundler 1.7 has a new feature that allows you to select the source for specific gems by nesting them in a block: source "https://rubygems.org

How to find unused gems in my Gemfile

徘徊边缘 提交于 2019-11-28 16:28:20
问题 How to find unused gems in my Gemfile, so that I can cleanup references which are no longer used. 回答1: I doubt if there is an automated way to find unused gems in the Gemfile. For someone who has built the application over time, it should be easy to manually identify gems that were discarded along the way for some reason or the other. For a legacy application inherited from someone else, it is a much difficult task to manually identify unused gems. If there is comprehensive test coverage for

bundle install returns “Could not locate Gemfile”

左心房为你撑大大i 提交于 2019-11-28 15:56:20
I'm new to Rails and am currently working through a guide. The guide states: Use a text editor to update the Gemfile needed by Bundler with the contents of Listing 2.1. source 'https://rubygems.org' gem 'rails', '3.2.3' group :development do gem 'sqlite3', '1.3.5' end # Gems used only for assets and not required # in production environments by default. group :assets do gem 'sass-rails', '3.2.4' gem 'coffee-rails', '3.2.2' gem 'uglifier', '1.2.3' end gem 'jquery-rails', '2.0.0' group :production do gem 'pg', '0.12.2' end We then install and include the gems using the bundle install command: $

Why doesn't “rails s” work from the app directory?

浪子不回头ぞ 提交于 2019-11-28 08:21:35
I'm in my app folder, but the command rails s is not working. I read through quite a few posts on Stack Overflow, and most of them seem to be from users who are not in their app directory. In addition, I built a few other apps. I checked those, and the Rails server works for all of those apps. This is the only one where I can't get it to launch. Output of which rails : /Users/jmcrist/.rvm/gems/ruby-2.0.0-p247/bin/rails Output of rails s : MacBook-Pro:first_app jmcrist$ rails s Usage: rails new APP_PATH [options] Options: -r, [--ruby=PATH] # Path to the Ruby binary of your choice # Default:

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

一世执手 提交于 2019-11-28 07:18:16
问题 Is the order in which you list your gems important? Are these two blocks equivalent? gem 'carrierwave' gem 'rmagick' And gem 'rmagick' gem 'carrierwave' 回答1: When you use Bundle.require (which Rails does), Gems are required in the order they appear in the Gemfile. In wasn’t always like this, but has been this way for a while. Since Carrierwave requires RMagick explicitly when it is needed, I don’t think it should matter in your case; but strictly speaking the two blocks are not equivalent.

Your Ruby version is 2.1.0, but your Gemfile specified 2.0.0

╄→尐↘猪︶ㄣ 提交于 2019-11-28 05:29:12
问题 In my Gemfile I specified ruby version 2.0.0: ruby '2.0.0' But my console tells me I have 2.1.0dev: $ ruby -v ruby 2.1.0dev (2013-09-16 trunk 42951) [x86_64-darwin12.4.0] I am using rbenv and it tells my I don't have 2.1.0 installed, $ rbenv versions system * 2.0.0-dev Bundle update or bundle install says: "Your Ruby version is 2.1.0, but your Gemfile specified 2.0.0" but using 'rbenv local 2.0.0-dev' leaves me with ruby 2.1.0dev again. Furthermore: $ rbenv global 2.0.0-dev $ cat ~/.bash

Rails app: using a gem vs. including source with Twitter Bootstrap

亡梦爱人 提交于 2019-11-28 04:47:31
I've gone through my app and am having trouble finding where exactly the Twitter Bootstrap source goes when I include it through a gem. If I wanted to view the Bootstrap .css for example, how do I find it? The alternative, as I understand, to including it as a gem would be do download and include the source directly, correct? Is one approach better than the other. Finally, if I wanted to modify the Bootstrap css what is the best way to do it? If I had the source in my app I imagine I could just go in there and modify things. How about if I'm including it as a gem? Some clarification on how