Running a forked repo - ruby-on-rails

I'm attempting to fork the repo and run it locally. Steps I took so far are:
Download repo
Change gemname gem version in version.rb to 1.4.0 because version is not available
Uninstall and reinstall bundler to version 1.6.1
Run bundle install
Get the error Make sure that gem install gemname -v '1.4' succeeds before bundling.
Run gem install gemname -v '1.4' and installed gem successfully
Run bundle install and I loop back to the error on step 5
I clearly have surveyor installed but yet bundler doesn't seem to recognize this. I'm a novice and very rusty on Rails.
Thanks in advance for your help!

To depend on a version of a gem in a Git repo, tell the bundler to fetch the gem from the repo.
gem 'surveyor', '~> 1.4', git: 'https://github.com/scwong93/surveyor/'
And then run bundle as normal. You should see...
Using surveyor 1.4.1.q from https://github.com/scwong93/surveyor/ (at master#e253789)
Look inside your Gemfile.lock and see that it has indeed found the repo version 1.4.1q by pulling it from the repo's master branch.
GIT
remote: https://github.com/scwong93/surveyor/
revision: e25378983fd465db701610eb076179c74db98c11
specs:
surveyor (1.4.1.q)
formtastic (~> 2.2.1)
haml (>= 4.1.0.beta.1)
mustache (~> 0.99)
rabl (~> 0.6)
rails (>= 3.2)
sass
uuidtools (~> 2.1)

Related

Bundler : Is there a way to set the version?

When trying to run 'bundle install', I have this message :
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 5.0.2) was resolved to 5.0.2, which depends on
bundler (>= 1.3.0, < 2.0)
Current Bundler version:
bundler (2.1.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (>= 1.3.0, < 2.0)', which is required by gem 'rails (= 5.0.2)', in any of the sources.
Bundler could not find compatible versions for gem "pg":
In Gemfile:
pg (= 0.18.3)
jsonb_accessor (~> 1.0.0) was resolved to 1.0.0, which depends on
pg (>= 0.18.1)
Then, I think I need to change my bundler version why is 2.1.2, I would like to change to 1.17.3.
gem list command says :
bundler (default 1.17.3)
but bundle -v command says :
Bundler version 2.1.2
I am using ruby 2.5.1 with RVM.
Do you have any idea how to do so ?
I read that I can use bundle config set but it does nothing.
Bundler installs a binary that gets invoked before your Gemfile is read, so you'll need to remove the version you are using and install the version you want.
You can do this with RVM with the following:
rvm #global do gem uninstall bundler -a -x -I || true
gem install bundler -v '= 1.17.3'
If you hop between projects, you may have to do this a lot, or you can do this:
gem install bundler -v '= 1.17.3'
And instead of using bundle install, use:
bundle _1.17.3_ install
to specify the version of the bundler gem gets used.
I would recommend you look into upgrading Rails, not only to get on a supported version (that has security updates), but it will also allow you to upgrade bundler again.
You need to delete manually the directory on your problematic ruby version: for example if there is a bundler problem with the 2.5.1 ruby version, go to this path:
/Users/YOUR_USER/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/
and delete the bundler directory.
If bundler is in the default specification you also need to remove the bundler associated file on this path:
/Users/YOUR_USER/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/specifications/default
Then you can re-install a specific version of bundler using #Unixmonkey answer

Bundle install could not find compatible versions for gem "bundler"

When I type bundle install I got this error. I tried to find solution but nothing solve my case. Please help me.
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 4.1.8) was resolved to 4.1.8, which depends on
bundler (< 2.0, >= 1.3.0)
Current Bundler version:
bundler (2.0.1)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails
(= 4.1.8)', in any of the sources.
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (= 4.1.8)
animate-rails was resolved to 1.0.10, which depends on
rails
Try to use
gem install bundler -v 1.17.3
bundle _1.17.3_ install
Your bundler gem is too big. You can downgrade for now by changing your gemfile to specify the lower version, and deleting the lock file again.
gem 'bundler', '1.17.1'
Then try these commands in the terminal
gem install bundler -v 1.17.1
gem uninstall bundler -v 2.0.1
bundle update --bundler
bundle install
That last install command might be redundant. I'm on my phone so I can't test anything unfortunately.
Best of luck!
EDIT:
This is now a Heroku issue. Got it. Heroku docs regarding Bundler
Libraries
The following libraries are used by the platform for managing and running >Ruby applications and cannot be specified. For application dependency resolution and management, bundler is installed based on the contents of your Gemfile.lock. If you have a BUNDLED WITH in your Gemfile.lock then you will receive a different version of Bundler:
Applications specifying Bundler 2.x in their Gemfile.lock will receive bundler: 2.0.1
Applications specifying Bundler 1.x in their Gemfile.lock will receive bundler: 1.15.2
Applications with no BUNDLED WITH in their Gemfile.lock will default to bundler: 1.15.2
For more information on available settings see Bundler configuration. For more information on why we only support a specific set of bundler versions, please see this article about your Bundler version.
So it seems like Heroku only allows certain versions of Bundler to be compatible, relevant doc is linked. Downgrade to 1.15.2 and give it another shot.
You don't need to uninstall the newest version of bundler (especially if you have other applications).
First find the bundler version that you need.
For example, after running bundle install:
Could not find gem 'bundler (>= 1.3.0, < 2.0)', which is required by gem 'rails (~> 4.2)', in any of the sources.
I need any version between 1.3.0 and 2.0. Hence, I would go for bundler 1.9.
Then, install the bundler:
gem install bundler -v 1.9
Run that bundler version to install gems:
bundler _1.9_ install

install ruby on rails Mac os

hello guys i have checked all people sharing about installing ruby on rails but its the same problem
like this:
Fetching selenium-webdriver 3.4.3
Using listen 3.1.5
Using rails-dom-testing 2.0.3
Using globalid 0.4.0
Using activemodel 5.1.2
Using jbuilder 2.7.0
Using spring 2.0.2
Using rails-html-sanitizer 1.0.3
Using capybara 2.14.4
Bundler::GemspecError: Could not read gem at
/usr/local/lib/ruby/gems/2.4.0/cache/selenium-webdriver-
3.4.3.gem. It may be
corrupted.
An error occurred while installing selenium-webdriver (3.4.3), and
Bundler cannot continue.
Make sure that gem install selenium-webdriver -v '3.4.3' succeeds before
bundling.
In Gemfile:
selenium-webdriver
run bundle exec spring binstub --all
Could not find gem 'sass-rails (~> 5.0)' in any of the gem sources listed in your Gemfile.
Run bundle install to install missing gems.
I have experience with this driver, and downgraded to lower version here is the sample that work with my system, you can delete minitest incase you don't need it. I'm using rails 5.0.2
group :development, :test do
gem 'selenium-webdriver', '2.53.4'
gem 'minitest-rails-capybara'
gem 'minitest-reporters'
end
Bundler is trying to fetch the selenium-webdriverfrom its cache. Also, bundler suggests that the package is probably corrupt. You can try removing it from cache so bundler can install the gem again.
rm -f /usr/local/lib/ruby/gems/2.4.0/cache/selenium-webdriver-3.4.3.gem
bundle install

Bundler could not find compatible versions for gem "bundler": In Gemfile: rails (= 3.0.0) was resolved to 3.0.0, which depends on bundler (~> 1.0.0)

I just bought a new MBP and I'm trying to execute a ruby app. After I followed this tutorial Install Ruby on Rails 5.0 ยท macOS Sierra,
I'm still having this issue:
MBP:test_app $ gem install rails
Successfully installed rails-5.0.1
Parsing documentation for rails-5.0.1
Done installing documentation for rails after 0 seconds
1 gem installed
MBP:test_app $ rails new .
Could not find gem 'rails (= 3.0.0)' in any of the gem sources listed in your Gemfile or available on this machine.
Try running `bundle install`.
Then, I tried:
$ bundle install
And I got the following error:
Fetching gem metadata from http://rubygems.org/..........
Fetching version metadata from http://rubygems.org/..
Fetching dependency metadata from http://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.0) was resolved to 3.0.0, which depends on
bundler (~> 1.0.0)
Current Bundler version:
bundler (1.13.7)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (~> 1.0.0)', which is required by gem 'rails (=
3.0.0)', in any of the sources.
I guess I've already tried everything; installed bundler 1.0.0, reinstalled, deleted gems, removed ruby, rails, rvm, and installed everything again.
Please, any advice?
Solved!!
The problem was solved removing or commenting config.action_view.debug_rjs = true in development.rb file.
Thanks to everyone!

For Rails, if there is a project that uses Rails 3.0.0, it looks for bundler 1.0.0 and it is there but rails server won't run?

I have a Rails 3.0.0 project that was using Ruby 1.9.2. Now that I tried to run it on a new computer with the current rvm, it will say:
$ rails s
/Users/michael/.rvm/gems/ruby-1.9.2-p318#global/gems/bundler-1.1.3/lib/bundler/resolver.rb:129:in `block in resolve': Bundler could not find compatible versions for gem "bundler": (Bundler::VersionConflict)
In Gemfile:
rails (= 3.0.0) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.1.3)
but I already used
gem install rails -v 3.0.0
gem install bundler -v 1.0.0
gem install bundler -v 1.0.2
so that when I gem list, I will see
bundler (1.1.3, 1.0.22, 1.0.0)
rails (3.0.0)
so how come it is still complaining that Rails 3.0.0 requires bundler 1.0.0 and it is not there? How to make the project run again?
Update: my Gemfile is mostly comments except:
source 'http://rubygems.org'
gem 'rails', '3.0.0'
gem 'sqlite3-ruby', :require => 'sqlite3'
Update 2: if I run bundle check:
$ bundle check
Your Gemfile's dependencies could not be satisfied
Install missing gems with `bundle install`
$ bundle install
Fetching gem metadata from http://rubygems.org/.........
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.0) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.1.3)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
The problem is that you have three version of bundler (1.1.3, 1.0.22, 1.0.0).And your app require only 1.0.0.And when you run server it use 1.1.3.
So first uninstall two bundler by this command
gem uninstall bundler -v=1.1.3
gem uninstall bundler -v=1.0.22
Then run server it will sure work....
You may need to run rails and rake inside the bundler context:
bundle exec rails s
Ditt with your rake commands, e.g.,
bundle exec rake -T
Here's a SO thread with links to more in depth articles. Also, lots of chatter about how to get around it if you get annoyed. Personally, I alias my most common commands anyway, so I don't even notice.
Just add Bundler into your gemfile to lock the version of bundler to use for that project.
gem 'bundler', '1.1.0'
If you do this you do not need to uninstall the other versions of Bundler, which you may be using on other projects with different dependencies.
You also shouldn't need to use bundle exec for any rails commands as Rails is bundler aware and will always run in the context of the current bundle. Non Rails commands require `bundle exec'.

Resources