I am just started learning Ruby rails and immediately facing problem.
I am using Windows 8.1, Ruby 2.2.3, Rails 4.2.5.
Problem is I installed twitter-bootstrap-rails gem, like this:
gem install twitter-bootstrap-rails
, and it said me everything have gone well, no problems. But when I type
bundle show twitter-bootstrap-rails
it says me there is no such gem. And for that reason I think I cant use rails generator, bootstrap is not in generators list:
rails g --help
I am completely new in Ruby. Any help will be appreciated. Thank you in advance!
It sounds like what you need to do is add the twitter-bootstrap-rails gem to your Gemfile, and run bundle install.
Although you installed the gem using gem install, bundler doesn't know that because it's not present in your Gemfile.
Once you add the gem to your Gemfile and run bundle install, bundle show should display the path of the installed gem. Your generators should work as well!
Related
I am currently trying to upgrade an existing app from Rails 4.2.3 to Rails 5.
then I followed this tutorial : http://railsapps.github.io/updating-rails.html
It recommends having RVM as Ruby version manager as well as gemsets manager. I am under windows 10 and because I couldn't find an easy solution to get RVM I have URU instead.
Well, no big deal. I have installed URU as well as another Ruby version enabling Rails 5 (Ruby 2.2.6)
Though, as mentionned below in the tutorial I have also tried to install nokogiri through command prompt:
gem install nokogiri
It failed with the following :
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen - C:/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri
-1.6.8.1-x86-mingw32/lib/nokogiri/2.2/nokogiri.so
Well I wasn't really bothered and decided to go on.. Though now every bundle install fails too !! But I dont even have any reference to nokogiri in my gemfile. (It is though in my gemfile.lock but if I try to remove it, I get a corrupt gemfile.lock error)
a bundle show gives the following:
Gems included by the bundle:
Your bundle is locked to nokogiri (1.6.8.1-x86-mingw32), but that version could
not be found in any of the sources listed in your Gemfile. If you haven't
changed sources, that means the author of nokogiri (1.6.8.1-x86-mingw32) has
removed it. You'll need to update your bundle to a different version of nokogiri
(1.6.8.1-x86-mingw32) that hasn't been removed in order to install.
Any easy solution to this ?
Delete your path folder(if it shows) and your Gemfile.lock .
Then place this in your gem file
gem 'nokogiri', '~> 1.6', '>= 1.6.8.1'
After that run bundle install .Remove the nokogiri from your gemfile
I'm working on a project and we've just updated bundler to version 1.7.0. There was a few days of trouble in getting all the gemfiles/gemfile.locks in a correct state, but I'm still having trouble with one issue in particular.
If there are differences in Gemfile.lock, I check it out, and then bundle so that I will have the gems in the Gemfile. However bundle seems to always auto-upgrade my gems. For example:
Installing multi_json 1.10.1 (was 1.9.2)
The rest of my team is using 1.9.2 - there's a dependency in another part of the application or...who knows. I should be using 1.9.2, but bundler consistently 'auto-upgrades' everytime i run bundle. Is there a way to prevent this behavior? I'm using RVM 1.25.23
Bundler 1.7.0 has some bugs which can result in unexpected gem updates. Please try upgrading to the latest version (1.7.2 at the time that I write this).
See:
https://github.com/bundler/bundler/issues/3136
https://github.com/bundler/bundler/issues/3142
https://github.com/bundler/bundler/issues/3149
Try:
bundle install --frozen
This should prevent bundler to update the Gemfile.lock.
I'm trying to install Redmine 2.3 from SVN (http://redmine.rubyforge.org/svn/branches/2.3-stable/)
I am using this tutorial (http://www.redmine.org/projects/redmine/wiki/HowToInstallRedmineOnUbuntuServer) as Ruby is not really my piece of cake....
I'm getting an error when running a command: rake generate_session_store
Could not find gem 'rails (= 2.3.14)' in any of the gem sources listed in your Gemfile.
Run bundle install to install missing gems.
I installed rails, but I still get the same error... searched for answers but this is really driving me crazy now.
:/usr/share/redmine# rails -v
Rails 2.3.14
Could anyone with more experience shed some light on it?
Run to install all dependent gems bundle install
run
bundle exec rake generate_session_store
this will call rake in scope of current installed gems.
In Redmine 2.x you have to use
rake generate_secret_token
Instead of the old (which is for Redmine 1.4.x)
rake generate_session_store
Source: http://www.redmine.org/projects/redmine/wiki/RedmineInstall
I have a site running with nginx/unicorn/sinatra (bundler/rvm).
After my last bundle update, I am getting an error:
in `raise_if_conflicts': Unable to activate dm-serializer-1.2.1, because multi_json-1.3.5 conflicts with multi_json (~> 1.0.3)
My Gemfile is:
source "http://rubygems.org"
gem 'unicorn'
gem 'sinatra'
gem 'datamapper'
gem 'dm-mysql-adapter'
gem 'haml'
gem 'sass'
gem 'omniauth-twitter'
Gemfile.lock does not have any reference to multi_json 1.0.3
Any ideas?
Solution was:
check Gemfile.lock to see which gem(s) bring in later version (in this case - omniauth-twitter)
Find a version of 'offender' that does not require too high version
Rollback later versions, lock to a proper version in Gemfile
In this particular case, Gemfile that works needed lines:
gem 'omniauth-twitter', '0.0.9'
gem 'multi_json', '~> 1.0.3'
One of the gems in your bundle has an older version of multi_json as a dependency it looks like. See if bundle viz tells you. You'll need to install the ruby-graphviz gem and graphviz itself if you don't have them installed already, though.
Another way to see what's up is to add multi_json to your gemfile at the version you're trying to upgrade to, then do a bundle install and see what errors come out.
This is how to fix this problem:
rvm uninstall multi_json
It will tell you that you have many versions installed, show you a list of them, and ask you which one exactly you want to uninstall.
Try the first one, if it tells you that it is used by some other gem, try the second one, and so on. Keep deleting all the unused versions until only one remains.
This is how I do it, but there may be some clearner solution. If anyone knows it, thanks for sharing it with us.
I installed mocha using gem install mocha and it did install successfully. There are no version requirements of a specific version in my GEMFILE.
I still get the error :
Could not find mocha-0.10.3 in any of the sources
Anyone knows why ?
To install gems from rubygems.org, you need to set the source :rubygems in the Gemfile, to make it look something like
source :rubygems
gem "mocha"
the problem might also be that your Gemfile.lock requires an older version due to some dependencies, than the one you've installed via gem install mocha, assuming that's what you did.
Showing contents of your Gemfile might help solve this easier though.
Looks like that version of mocha was yanked from RubyGems, so you will need a newer version. If you're not hardlocked to a specific version in your Gemfile, then try a bundle update mocha to update your Gemfile.lock. Otherwise, make sure you're using the spermy operator to specify the version in your Gemfile:
gem "mocha", "~> 0.10.5"