Getting error when creating Rails 3.2.16 app - ruby-on-rails

I am using this command to create my rails app (version 3.2.16)
rails 3.2.16 new myapp
but I am getting following error
/home/hardik/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'railties' (= 3.2.16) - did find: [railties-4.0.0,railties-3.2.14,railties-3.2.13] (Gem::LoadError)
from /home/hardik/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /home/hardik/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /home/hardik/.rvm/gems/ruby-2.0.0-p247/bin/rails:22:in `<main>'
from /home/hardik/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
from /home/hardik/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
Thanx in advance

Look at the error message
Could not find 'railties' (= 3.2.16) - did find: [railties-4.0.0,railties-3.2.14,railties-3.2.13]
You have not installed rails 3.2.16, but you have 4.0.0, 3.2.14 and 3.2.13
rails new myapp
should do it
If you need to specify the rails version, you should use rvm or rbenv

Related

getting error on rails -v / rails new app

getting error on rails new myapp
/home/high-tech/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'railties' (>= 0) among 19 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/home/high-tech/.rvm/gems/ruby-2.2.3:/home/high-tech/.rvm/gems/ruby-2.2.3#global', execute `gem env` for more information
from /home/high-tech/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
from /home/high-tech/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
from /home/high-tech/.rbenv/versions/2.2.0/bin/rails:22:in `<main>'
Rails' dependencies might not be correctly installed.
Try the following:
bundle show railties
If it fails:
gem install railties
to install the gem.
Hope it helps.

Cannot run "ruby script/server" rails/version (LoadError)

I am facing a problem starting the server for a ruby app built by somebody else. When I run the "ruby server/script" command, the following output is generated:
ruby script/server
./script/../config/../vendor/rails/railties/lib/initializer.rb:7:in `require': no such file to load -- rails/version (LoadError)
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:7
from ./script/../config/boot.rb:45:in `require'
from ./script/../config/boot.rb:45:in `load_initializer'
from ./script/../config/boot.rb:38:in `run'
from ./script/../config/boot.rb:11:in `boot!'
from ./script/../config/boot.rb:109
from script/server:2:in `require'
from script/server:2
I have looked, and looked and no solution seems in sight.
Specs:
Ruby 1.8.7,
Rails 2.2.2,
gem -v 1.8.25
EDIT:
After doing that, I still get the same error:
[dralexmv#archbang rubygame]$ ruby script/server
./script/../config/../vendor/rails/railties/lib/initializer.rb:7:in `require': no such file to load -- rails/version (LoadError)
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:7
Versions:
[dralexmv#archbang rubygame]$ gem -v
1.4.2
[dralexmv#archbang rubygame]$ rails -v
Rails 2.2.2
[dralexmv#archbang rubygame]$ ruby -v
ruby 1.8.7 (2012-10-12 patchlevel 371) [x86_64-linux]
EDIT: GEM LIST
*** LOCAL GEMS ***
actionmailer (2.2.2)
actionpack (2.2.2)
activerecord (2.2.2)
activeresource (2.2.2)
activesupport (2.2.2)
bundler (1.2.4)
json (1.7.7)
mysql (2.9.1)
rails (2.2.2)
rake (10.0.3)
rdoc (4.0.0)
rubygems-bundler (1.1.0)
rubygems-update (1.4.2)
rvm (1.11.3.6)
sqlite3 (1.3.7)
EDIT: Test on a test app
[dralexmv#archbang test_a]$ ruby script/server
=> Booting WEBrick...
=> Rails 2.2.2 application started on `http://0.0.0.0:3000`
=> Ctrl-C to shutdown server; call with --help for options
[2013-03-10 12:06:35] INFO WEBrick 1.3.1
[2013-03-10 12:06:35] INFO ruby 1.8.7 (2012-10-12) [x86_64-linux]
[2013-03-10 12:06:35] INFO WEBrick::HTTPServer#start: pid=11230 port=3000
Downgrade your gem and try. Rails 2.X doesn't work with gem version greater than 1.5
sudo gem update --system 1.4.2

RVM installation ruby 1.8.7 and rails 2.3.4 Could not find gem 'rails (= 1.8.7) ruby' in the gems available on this machine. (Bundler::GemNotFound)

I need to install ruby 1.8.7 and rails 2.3.4 because I need to modify an old application.
(latest ruby and gems in RVM working for me fine, but I need to use this old gems and ruby)
//runing ubuntu 12.04
problem is when i try to run rake gems:install
(and I cannot do rails new app also)
I cannot solve this and I do not have much time.
Thanks in advance for any help.
$ rvm use 1.8.7
Using /home/user/.rvm/gems/ruby-1.8.7-p370
$ rvm gemset use gemset234
Using ruby-1.8.7-p370 with gemset gemset234
$ gem list
* LOCAL GEMS *
actionmailer (2.3.4)
actionpack (2.3.4)
activerecord (2.3.4)
activeresource (2.3.4)
activesupport (2.3.4)
bundler (1.1.5, 0.9.1)
rack (1.0.1)
rails (2.3.4)
rake (0.9.2.2, 0.8.7)
rubygems-bundler (1.0.3)
rubygems-update (1.8.24)
rvm (1.11.3.5)
$ rake gems:install
/home/user/.rvm/gems/ruby-1.8.7-p370#gemset234/gems/bundler-1.1.5/lib/bundler/resolver.rb:287:in `resolve': Could not find gem 'rails (= 1.8.7) ruby' in the gems available on this machine. (Bundler::GemNotFound)
from /home/user/.rvm/gems/ruby-1.8.7-p370#gemset234/gems/bundler-1.1.5/lib/bundler/resolver.rb:161:in `start'
from /home/user/.rvm/gems/ruby-1.8.7-p370#gemset234/gems/bundler-1.1.5/lib/bundler/resolver.rb:128:in `resolve'
from /home/user/.rvm/gems/ruby-1.8.7-p370#gemset234/gems/bundler-1.1.5/lib/bundler/resolver.rb:127:in `catch'
from /home/user/.rvm/gems/ruby-1.8.7-p370#gemset234/gems/bundler-1.1.5/lib/bundler/resolver.rb:127:in `resolve'
from /home/user/.rvm/gems/ruby-1.8.7-p370#gemset234/gems/bundler-1.1.5/lib/bundler/definition.rb:192:in `resolve'
from /home/user/.rvm/gems/ruby-1.8.7-p370#gemset234/gems/bundler-1.1.5/lib/bundler/definition.rb:127:in `specs'
from /home/user/.rvm/gems/ruby-1.8.7-p370#gemset234/gems/bundler-1.1.5/lib/bundler/environment.rb:27:in `specs'
from /home/user/.rvm/gems/ruby-1.8.7-p370#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
from /home/user/.rvm/gems/ruby-1.8.7-p370#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:60:in `setup'
from /home/user/.rvm/gems/ruby-1.8.7-p370#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:75
from /home/user/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:60:in `gem_original_require'
from /home/user/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:60:in `require'
from /home/user/.rvm/gems/ruby-1.8.7-p370#gemset234/bin/ruby_noexec_wrapper:9
This is a drawback to the gem installation system in rails 2. If there is a dependency required for rake to run, like rails in this case, you will need to install it manually. Do gem install for each of these dependencies until rake finally runs.

undefined method `cattr_accessor' for RailsUpgrade::Upgraders::RouteRedrawer:Class

I was upgrading a Rails 2 application to Rails 3.
Then I installed rails-upgrade gem:
$ gem install rails-upgrade --user-install
Fetching: rails-upgrade-0.0.2.gem (100%)
PostInstall.txt
Successfully installed rails-upgrade-0.0.2
1 gem installed
Installing ri documentation for rails-upgrade-0.0.2...
Installing RDoc documentation for rails-upgrade-0.0.2...
And then I ran check, but it raise this error:
$ rails-upgrade check
/home/neoriddle/.gem/ruby/1.8/gems/rails-upgrade-0.0.2/lib/rails-upgrade/upgraders/routes.rb:28: undefined method `cattr_accessor' for RailsUpgrade::Upgraders::RouteRedrawer:Class (NoMethodError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `require'
from /home/neoriddle/.gem/ruby/1.8/gems/rails-upgrade-0.0.2/lib/rails-upgrade.rb:12
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `require'
from /home/neoriddle/.gem/ruby/1.8/gems/rails-upgrade-0.0.2/bin/rails-upgrade:7
from /home/neoriddle/.gem/ruby/1.8/bin/rails-upgrade:19:in `load'
from /home/neoriddle/.gem/ruby/1.8/bin/rails-upgrade:19
What is wrong and how can I solve it?
I have installed Rails 3 and all dependencies required:
$ rails -v
Rails 3.0.9
$ ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux]
$ gem list active
*** LOCAL GEMS ***
active_scaffold_vho (3.0.20)
activemerchant (1.15.0, 1.14.0)
activemodel (3.0.9, 3.0.7, 3.0.5, 3.0.3)
activerecord (3.0.9, 3.0.7, 3.0.3, 2.3.11, 2.3.5, 2.2.3, 2.1.2, 2.1.1, 2.0.5, 1.15.3)
activeresource (3.0.9, 3.0.7, 3.0.3, 2.3.11, 2.3.5, 2.2.3, 2.1.2, 2.1.1)
activesupport (3.0.9, 3.0.7, 3.0.5, 3.0.3, 2.3.11, 2.3.5, 2.2.3, 2.1.2, 2.1.1, 2.0.5, 1.4.2)
$ gem list action
*** LOCAL GEMS ***
actionmailer (3.0.9, 3.0.7, 3.0.3, 2.3.11, 2.3.5, 2.2.3, 2.1.2, 2.1.1, 1.3.3)
actionpack (3.0.9, 3.0.7, 3.0.3, 2.3.11, 2.3.5, 2.2.3, 2.1.2, 2.1.1, 1.13.3)
actionwebservice (1.2.6, 1.2.3)
If you need more infor please ask me.
I don't think this gem has been updated to be compatible with Rails 3. The only other alternative is grabbing yourself a copy of the Rails 3 Upgrade Handbook and using that to go through the upgrade process.
I wrote a blog post about upgrading a Rails 2 application to Rails 3 here: http://ryanbigg.com/2010/11/the-rails-3-upgrade/.

RubyGem version error: activesupport(1.4.4 not = 3.0.0.beta) (Gem::LoadError)

I want to use the last version of rails, in my Gemfile: gem 'rails', '3.0.0.beta3'
When trying to start my server I get this error, do you know how I can fix this issue?
$rails s
/Library/Ruby/Site/1.8/rubygems.rb:777:in `report_activate_error': RubyGem version error: activesupport(1.4.4 not = 3.0.0.beta) (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems.rb:211:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:246:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:245:in `each'
from /Library/Ruby/Site/1.8/rubygems.rb:245:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:1056:in `gem'
from /usr/bin/rails:18
bundle install return Your bundle is complete!
gem list give me
activesupport (3.0.0.beta3, 2.3.5, 2.2.2, 1.4.4)
ok so you have activesupport 3.0.0.beta3 while it requires activesupport 3.0.0.beta. Try this:
gem install activesupport -v 3.0.0.beta --pre

Resources