I'm working on a newly configured computer, and can't seem to get rails to play nicely with my gems. Below are some of the errors I'm running into.
If I run 'script/console' in a rails project, I get the following error:
Missing the Rails gem. Please gem install -v= rails, update your RAILS_GEM_VERSION
setting in config/environment.rb for the Rails version you do have installed, or comment
out RAILS_GEM_VERSION to use the latest version installed.
If I run 'rails -v' I get the following error:
/Library/Ruby/Site/1.8/rubygems.rb:777:in `report_activate_error': RubyGem version
error: activesupport(1.4.4 not = 2.3.4) (Gem::LoadError)
Both activesupport and rails gems are installed and updated, and are listed when I run 'gem list.' Any ideas? Thanks!
Is the location of the gems defined? (either in ~/.bash_profile or ~/.bashrc)
Something like:
export GEM_PATH=/Library/Ruby/Gems/1.8/:${GEM_PATH}
You'll want to see if you have gems on your home directory or off the root. You can do this by running gem environment.
Related
I already have a live Rails application which is running in rails 5.0.1. Now, when I try to create new rails version I get the following error
Could not find proper version of railties (4.2.7.1) in any of the sources
Run `bundle install` to install missing gems.
When I run 'bundle install' I get the following error
Could not find spork-1.0.0rc4 in any of the sources
How can I solve this error?
My System only have Rails 5.0.1 version and Ruby version 2.3.1.
PS: When I keep Ruby version in 2.2.5, I am able to create my rails app successfully.
If you're trying to create a new rails application, try setting it up in a new folder.
If you're trying to update the rails version of your current project update the rails version in your Gemfile and run bundle update rails.
Prepending the command that's giving you
Could not find proper version of railties (4.2.7.1) in any of the sources
Run `bundle install` to install missing gems.
with bundle exec may solve your problem.
If you're using something like rbenv to manage your ruby version, you may have to update your .ruby-version file, and then run
rbenv install
gem install bundler
bundle install
to install that new version of ruby, bundler and your gems.
I am learning Ruby on Rails and I followed the installation of RVM and Rails from Ryan Bigg's blog and the Agile Wed Development book. This has worked previously on my PC at home, but at work it gives me the error:
depot$ rails -v
Could not find gem 'sqlite3 (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
I am trying to generate a scaffold but this is what i get:
depot$ rails generate scaffold Product \ title:string description:text image_url:text price:decimal
Could not find gem 'sqlite3 (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
I have sqlite3 installed, RVM 1.9.2-p320, and running on Ubuntu 11.04.
Any ideas what can be causing this and how to fix it?
Run
bundle install
in your Rails app's directory just like both error messages instruct you to.
i had the same issue you could try to run sudo apt-get install libsqlite3-dev and bundle install in the app directory.
You need to run it from your app directory so it can find the Gemfile to know which gems it needs to install from the Gemfile.
Yes. I was also having the same problem
when I started with rails, then when writing "rails new " I got this problem of sqlite3 . This appears due to the reason that "bundle install" is not executed. When we try to 'bundle install' then it will show some gemfile missing error. This happens due to the reason that we haven't changed the directory to that folder where we are using the rails application. So for solving this problem follow these steps :
type 'rails new app' // instead of app you can type any name you want.
now a folder named app will be created in your home.
now start new terminal.
type 'cd app'
now you can continue your work, and you will not face any such problem.
I am running a Debian squeeze server with these (backported) packages installed:
rails 2.3.5-1~bpo50+1
rails-ruby1.8 2.3.5-1~bpo50+1
rake 0.8.7-1~bpo50+1
libapache2-mod-passenger 2.2.11debian-1~bpo50+1
I have a Rails application I am trying to run in this environment, but when I load the page I get this error message:
Actual load error: Could not find
RubyGem rails (= 2.3.5) Missing the
Rails 2.3.5 gem. Please gem install
-v=2.3.5 rails, update your RAILS_GEM_VERSION setting in
config/environment.rb for the Rails
version you do have installed, or
comment out RAILS_GEM_VERSION to use
the latest version installed.
There is a constraint that I must use these "official" Rails and mod_passenger Debian packages, so installing Rails and mod_passenger the traditional way via gems is not a possibility.
There is no real reason that you should have to use offical gems from debian. You get faster security updates by using rubygems or going for fullblown rvm.
However I would suggest commenting out the RAILS_GEM_VERSION in config/environment.rb and then it should use the version you have installed.
This seems to work:
ln -s /usr/share/rails-ruby1.8/ /usr/share/myrailsproject/vendor/rails
I followed all the guidelines given on the heroku blog for deploying a Rails app. I also my app got pushed successfully and created an app in my account. But when I try to run my site it gives me the following error:
App crashed
This application is temporarily offline.
If you're the administrator of this app, please check your heroku logs for the
backtrace.
I tried to check the logs and here's what I got
C:\Users\raw\Desktop\html\rohit>heroku logs
Missing the Rails 2.3.8 gem. Please `gem install -v=2.3.8 rails`, update your RAILS_GEM_
VERSION setting in config/environment.rb for the Rails version you do have installed, or
comment out RAILS_GEM_VERSION to use the latest version installed.
==> dyno-3674485.log (crash) <==
Missing the Rails 2.3.8 gem. Please `gem install -v=2.3.8 rails`, update your RAILS_GEM_
VERSION setting in config/environment.rb for the Rails version you do have installed, or
comment out RAILS_GEM_VERSION to use the latest version installed.
-----> Rails can't find the expected version.
Check to ensure you have specified the correct version of Rails in your
Gemfile or .gems. See http://docs.heroku.com/gems for details.
You may also be affected by a gem dependency issue with rack.
See http://docs.heroku.com/gem-dependency for details.
Examine the backtrace above this message to debug.
II have made a .gems file in my Rails_App directory:
rails -v '2.3.8'
pg
rack -v '1.1.0'
haml -v '3.0.13'
formtastic -v '0.9.8'
authlogic -v '2.1.5'
subdomain-fu -v '0.5.4'
compass -v '0.10.2'
compass-colors -v '0.3.1'
paperclip -v '2.3.3'
activemerchant -v '1.9.0'
icalendar
What can I do to get this to work?
Rails 2.3.8 is not compatible with rack 1.2.1 You can't define you .gems like that you have a "gem dependency issue with rack" like define.
Try with rake -v=1.1.0 the dependency of ActionPack 2.3.8 ( http://rubygems.org/gems/actionpack/versions/2.3.8)
My Heroku app, running on bamboo-ree-1.8.7 stack, (run heroku info to determine what stack you are running), I have the following configuration:
first line of my .gems file
rails --version 2.3.8
You may also need to add the following to your config/environment.rb file
config.gem 'rails', :version => '2.3.8'
You will need to do another git push to heroku for these changes to take effect.
I added the command to ignore depedencies in the .gems file as --ignore-depedencies and now it works thanks guyz for your time.
The issue is solved.
PS: I had kept the solution as a comment, now submitting it as an answer.
I am trying to run Rails3 on XP Profesoinal and following the tutorial here http://railstutorial.org and am receiving the following errors all the time, even trying to return static pages. The message is the procedure entry point rb_str2cstr could not be located in the dynamic link library msvcrt-ruby191.dll
Also, the page gives a runtime error "no driver for sqlite3 found" even though i haven't created any models yet. The sqlite3.exe, sqlite3.dll and sqlite3.def are all in the bin folder and I have run Gem install sqlite3-ruby.
I have also tried gem install mongrel --pre and the instructions given http://www.ruby-forum.com/topic/202770#882858, but nothing is working
Here is my minimal fix for the problem:
ruby -v => 1.9.2p0
rails -v => 3.0.0
gem -v => 1.3.7
download sqlitedll-3_7_3.zip from http://sqlite.org/download.html
copy sqlite3.def and sqlite3.dll to ruby/bin
edit Gemfile:
gem 'sqlite3-ruby', '1.3.1', :require => 'sqlite3'
del Gemfile.lock
bundle install
rake db:migrate
Ruby 1.9.2, Rails 3.0
rake db:migrate produces the error message:
The procedure entry point rb_str2cstr could not be located in the dynamic link library msvcrt-ruby191.dll
Resolved by the following:
Delete gemlock.
Change SQLite version to 1.3.1.
Run: bundle install.
rake db:migrate now produces the correct results.
My versions:
ruby -v => 1.9.2p0
rails -v => 3.0.0
gem -v => 1.3.7
Gemfile:
gem 'sqlite3-ruby', :require => 'sqlite3'
Then:
Deleted Gemfile.lock
rake db:migrate
This fixed the error that you mentioned (The same windows pop-up).
Metoo. I was trying to run rake db:migrate on Vista-64. (same book).
Follow-up: I had been trying to solve some other problem by uninstalling and re-installing things and probably messed things up. When I ran into this problem no amount of 'gem uninstall' or 'bundle install's would solve it. Until I removed my Gemfile.lock and did a 'Bundle install'. Then my 'rake db:migrate' ran w/o error. It didn't look like bundle installed anything since all output was 'Using xxx', but I'll take it.
for me this meant "“you need to update your sqlite3-ruby gem version somehow" http://betterlogic.com/roger/?p=3027
I had the same problem with XP Pro and the Rails tutorial. I had SQLite version 1.2.5 installed, which matched what it says in Chapter 2 of the tutorial.
But when I saw roger's comment about using version 1.3.1, I installed that version (using "gem install sqlite3-ruby -v 1.3.1"). But it gave a message about using SQLite version 3.6.23.1 with this gem, along with the relevant website. So I downloaded it and replaced the sqlite3 .exe, .dll and .def files in the C:\Ruby192\bin directory.
Then I looked in the gemfile and saw that the SQLite version was 1.2.5 (as per the tutorial). So I changed it to 1.3.1, deleted gemfile.lock, ran "bundle install" again, and after that "rake db:migrate" worked.