execute "vagrant up" from ROR application - ruby-on-rails

I have an ROR application from which I am trying to execute vagrant up command in the following way system("vagrant up")
I am getting the below error
Vagrant experienced a version conflict with some installed plugins!
This usually happens if you recently upgraded Vagrant. As part of the
upgrade process, some existing plugins are no longer compatible with
this version of Vagrant. The recommended way to fix this is to remove
your existing plugins and reinstall them one-by-one. To remove all
plugins:
rm -r ~/.vagrant.d/plugins.json ~/.vagrant.d/gems
Note if you have an alternate VAGRANT_HOME environmental variable
set, the folders above will be in that directory rather than your
user's home directory.
The error message is shown below:
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
vagrant (= 1.7.2) x86-mingw32 depends on
bundler (< 1.8.0, >= 1.5.2) x86-mingw32
Current Bundler version:
bundler (1.10.0.pre.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.8.0, >= 1.5.2) x86-mingw32', which is required by gem 'vagrant (= 1.7.2) x86-mingw32', in any of the sources.
I have tried to do gem install bundler , it always installs bundler 1.9.9
If i try to execute vagrant up from command line it works fine
Below are the versions which I am using
ruby -> 2.1.6p336 (2015-04-13 revision 50298) [x64-mingw32]
Vagrant -> 1.7.2
Rails -> 4.2.1
Any sort of help is much appreciated

Related

rails bundler default version not accepting

i m trying to run a rails application is my system but i m facing the issue is bundle version, i tried to install the required version but its not installling that one version and i m not able to remove the default version of bundler . i tried to go into installation_path:/specications/default/
and i remove the default version from this directory but still its showing the latest default version and current version
i m using rails 7.
but project is in lower than 7.
so what should i do?
In Gemfile:
rails (~> 3.2.21) was resolved to 3.2.22.5, which depends on
bundler (~> 1.0)
Current Bundler version:
bundler (2.3.24)
Your bundle requires a different version of Bundler than the one you're running.
Install the necessary version with `gem install bundler:1.17.3` and rerun
bundler using `bundle _1.17.3_ install````

Why is Bundler repeatedly choosing gems that require a newer version of Ruby

I've just started working on a very old legacy app for a client, which is running on Ruby 1.9.3, Rails 3.2, and using JRuby on the production server. (Obstacles in upgrading the server has been a contributor to remaining on 1.9.3.)
Adding a gem to the Gemfile, even though the gem is compatible with 1.9.3, and even though I've added
ruby '1.9.3', :patchlevel => '551'
to the top of the Gemfile, Bundler continually chooses versions of other gems that require Ruby 2.0, and so updating fails. How can I get around this, without having to manually specify every single gem version that it fails on.
For example:
...
Using quiet_assets 1.1.0
Using rails 3.2.22
Using ref 2.0.0
Using rspec-rails 2.14.2
Fetching rspec_junit_formatter 0.3.0 (was 0.2.3)
Installing rspec_junit_formatter 0.3.0 (was 0.2.3)
Gem::InstallError: rspec_junit_formatter requires Ruby version >= 2.0.0.
An error occurred while installing rspec_junit_formatter (0.3.0), and Bundler cannot continue.
Make sure that `gem install rspec_junit_formatter -v '0.3.0'` succeeds before bundling.
I had to specify gem 'rspec_junit_formatter', '0.2.3', as well as all of the previous failures, in order to get this working. But that seems to defeat the purpose of Bundler. Why is Bundler ignoring Ruby versions when it builds its dependency graph, even though I've explicitly told it what version of Ruby to use?
Bundler is not ignoring the ruby version. When it installs gems it does not look at each gem and do a smart pick of which one to choose to get rid of any dependency issues (including the ruby version dependency).
In your gemfile, by not specifying the gem version, bundler will try to install the highest version it can. This is why it is good practice to specify exact versions for all your gems- so that if an update comes out for a gem in the repo you are getting the gem from- your project does not break.
Specifying the ruby version in the gem file is just like specifying the gem version for particular gem- it installs that version but does not affect the installation of any other gems.

Gem dependency hell installing redmine with CRM plugins

I was installing a clean Redmine 3.0 with CRM plugin on a fresh install of Ubuntu Server 14.04LTS. I succeeded with redmine and a minor plugin, but the CRM one has hit me with this:
# bundle install --without development test RAILS_ENV=production
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Warning: this Gemfile contains multiple primary sources. Using `source` more
than once without a block is a security risk, and may result in installing
unexpected gems. To resolve this warning, use a block to indicate which gems
should come from the secondary source. To upgrade this warning to an error, run
`bundle config disable_multisource true`.
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "i18n":
In Gemfile:
rails (= 4.2.0) ruby depends on
actionpack (= 4.2.0) ruby depends on
activesupport (= 4.2.0) ruby depends on
i18n (~> 0.7) ruby
money (~> 5.1.0) ruby depends on
i18n (~> 0.6.0) ruby
I installed i18n 0.6.0 and 0.7.0, didn't fix:
# gem list --local | grep i18n
i18n (0.7.0, 0.6.0)
I tried removing the Gemfile.lock and using bundler (bundle update && bundle install) again, same result.
I have no idea how to proceed with this issue. I know very little of ruby, gems and bundler and searching has failed me. Help, please.
You can't use the CRM plugin from redminecrm.com with Redmine 3 right now.
At the time of writing, the plugin is only compatible to Redmine 2.x. While the plugin will probably get updated by the authors, it is not yet compatible with Redmine 3.0.
Generally, you should not expect plugins to magically continue to work across major version updates. Especially when there was a major update recently, many plugins will not yet be compatible to the new Redmine version. If you need the plugins, you might be able to use an older version, e.g. Redmine 2.6, until all the plugins you need are updated.
You always have to check if a plugin is compatible to the Redmine version you intend to use.

Trouble installing gems with bundler

I'm new to Rails, following Michael Hartl's textbook. When I run $ bundle install I get the following error:
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.1) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.7.6)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
I then try $ gem install bundler which works fine:
Successfully installed bundler-1.7.6
Parsing documentation for bundler-1.7.6
1 gem installed
However, this doesn't solve the problem. I'm sensing this has something to do with version problems, but I'm not sure where to go with it...
The following :
In Gemfile:
rails (= 3.0.1) ruby depends on
bundler (~> 1.0.0) ruby
means the version of bundler required is greater than or equal to 1.0.0 but strictly less than 1.1.0. Rails 3 is depending on an old version of bundler. At this point of time, you should try out Rails 4 instead :)
You may read up more about the "version syntax" in http://guides.rubygems.org/patterns/#pessimistic_version_constraint
As #user3927334 has already stated the error you got is due to a version conflict between bundler and rails.
Most likely you have run rails new my_app with an outdated version of the rails gem.
gem install rails -v 4.2.0.beta4
Can be used to install a particular version of Rails. see Installing Rails.
You should then remove your old app and rerun the app generator:
rails _4.2.0.beta4_ new hello_app
If you indent to develop on your local machine I would recommend installing RVM (Ruby Version Manager) (as did previous versions of MH's Ruby on Rails Tutorial.)
It allows you to effortlessly switch between different versions of ruby and different sets of gems.

Issue with bundle install using spree from a git clone:

Error message: Bundler could not find compatible versions for gem "spree_core":
*In Gemfile:
spree_paypal_express (>= 0) ruby depends on
spree_core (>= 1.0.0) ruby
spree (= 0.50.2) ruby depends on
spree_core (0.50.2)*
When I do rails --version, I get:
git://github.com/shuber/sortable.git (at master) is not checked out. Please run `bundle install`
Have tinkered with the .bashrc profile as suggested by other StackOverflow posts, 'bundle update' gives the same error message as the first one above.
Mac OS X Lion
Rails 3.0.7
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin11.3.0], MBARI 0x6770, Ruby Enterprise Edition 2011.03
'rvm gem list bundler' returns 1.1.3 and 1.1.3 only, on my working environment with this git clone I have bundler 1.1.3 and 1.0.22.
Thoughts? Not really sure what to do at this point. I tried deleting Gemfile.lock and running bundle install again, but no success.
How are you specifying the spree gem in your Gemfile? The error message seems to say you're specifying one version of 'spree' (possibly =0.50.2), while spree_paypal_express is requiring another version (>= 1.0.0).
I'm not too familiar with bundler, so I can't say for certain. Maybe posting your Gemfile can help us find more leads for you?
Good luck!

Resources