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/.
Related
I fail to install rails properly for some reason. gem install rails says everything is fine but I cannot use it due to some missing gemfile. What am I doing wrong?
I am working on a mac Sierra.
$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
$ gem install rails
Fetching: rails-5.1.4.gem (100%)
Successfully installed rails-5.1.4
1 gem installed
$ rails -v
Could not locate Gemfile or .bundle/ directory
$ gem list rails
*** LOCAL GEMS ***
jquery-rails (4.3.1)
less-rails (3.0.0, 2.8.0)
rails (5.1.4)
rails-dom-testing (2.0.3, 2.0.2, 2.0.1)
rails-html-sanitizer (1.0.3)
rails_12factor (0.0.3)
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
rspec-rails (3.7.2)
sprockets-rails (3.2.1, 3.2.0)
twitter-bootstrap-rails (4.0.0, 3.2.2)
I try installing Redmine (that means ruby and rails) on my OFFLINE ubuntu 14.04.
I installed ruby OK, compiling from source:
$ ruby -v
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
I installed bundler, creating the gem thanks to rake and then installing the gem:
$ gem list
*** LOCAL GEMS ***
bigdecimal (default: 1.3.0)
bundler (2.0.0.dev)
did_you_mean (1.1.0)
io-console (default: 0.4.6)
json (default: 2.0.2)
minitest (5.10.1)
net-telnet (0.1.1)
openssl (default: 2.0.3)
power_assert (0.4.1)
psych (default: 2.2.2)
rake (12.0.0)
rdoc (default: 5.0.0)
test-unit (3.2.3)
xmlrpc (0.2.1)
I then want to install downloaded gems locally, but bundler doesn't seem to be installed. When I check, it is apparently the case:
$ bundle -v
/usr/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler (LoadError)
from /usr/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/gems/2.4.0/gems/bundler-2.0.0.dev/exe/bundle:10:in `<top (required)>'
from /usr/bin/bundle:22:in `load'
from /usr/bin/bundle:22:in `<main>'
How can I solve this?
Thanks a lot
César
I'm having an issue with rails 3.0.7 that led me to this subquestion:
Where can I find the list of rails version for 3.0, e.g. 3.0.0, 3.0.1, 3.0.11,. etc. ?
I've googled and looked at wikipedia and SO and a variey of the main ruby sites but can't find this 'list of versions' info.
$ gem list -r --all rails
rails (3.2.2, 3.2.1, 3.2.0, 3.1.4, 3.1.3, 3.1.2, 3.1.1, 3.1.0, 3.0.12, 3.0.11, 3.0.10, 3.0.9, 3.0.8, 3.0.7, 3.0.6, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 2.3.14, 2.3.12, 2.3.11, 2.3.10, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.4, 2.0.2, 2.0.1, 2.0.0, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.0, 0.14.4, 0.14.3, 0.14.2, 0.14.1, 0.13.1, 0.13.0, 0.12.1, 0.12.0, 0.11.1, 0.11.0, 0.10.1, 0.10.0, 0.9.5, 0.9.4.1, 0.9.4, 0.9.3, 0.9.2, 0.9.1, 0.9.0, 0.8.5, 0.8.0)
You can see all published gems at rubygems.org:
http://rubygems.org/gems/rails/versions
You can also have a look at branches and tags on github:
https://github.com/rails/rails
You can find it on rubygems.org, see all versions of rails
You can find all rails via github tags:
https://github.com/rails/rails/tags
I've looked all over the web for about a week now and not found a solution to my problem. I have a Ruby on Rails application I'm trying to deploy to a production Ubuntu 10.04 server edition box. I've got Apache2.2 and Passenger3.0.0 installed with Ruby 1.8.7, Rails 2.3.5 and RubyGems 1.3.7. My rails application is in /var/rails_app_name/ and rubygems/ruby is installed at /var/lib/gems/1.8
I have a test server with ubuntu 10.04 (gui edition) running the same setup and configuration which works like a charm. The only difference is my rails application root is in the user local folder e.g. /home/username/rails_app_name/
My problem is that on the production server, Passenger is giving me an error: "Missing the Rails 2.3.5 gem. Please 'gem install -v=2.3.5 rails'. update your RAILS_GEM_VERSION...."
I installed the rails gem in both gem directories listed by running a gem environment. Here are some config results:
%> gem environment
RUBYGEMS VERSION: 1.3.7
RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
INSTALLATION DIRECTORY: /var/lib/gems/1.8
RUBY EXECUTABLE: /usr/bin/ruby1.8
EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
RUBYGEMS PLATFORMS:
ruby
x86-linux
GEM PATHS:
/var/lib/gems/1.8
/home/sross/.gem/ruby/1.8
GEM CONFIGURATION:
:update_sources => true
:verbose => true
:benchmark => false
:backtrace => false
:bulk_threshold => 1000
REMOTE SOURCES:
http://rubygems.org/
%> gem list
actionmailer (2.3.5)
actionpack (2.3.5)
activemodel (3.0.3)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (3.0.3, 2.3.5)
acts_as_audited (1.1.1)
arel (2.0.4)
authlogic (2.1.6)
builder (2.1.2)
cancan (1.4.1)
daemon_controller (0.2.5)
fastthread (1.0.7)
file-tail (1.0.5)
i18n (0.4.2)
passenger (3.0.0)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
spruz (0.2.2)
tzinfo (0.3.23)
%> which gem
/usr/bin/gem
%> which ruby
/usr/bin/ruby
** /etc/apache2/mods-enabled/passenger.conf **
PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.0
PassengerRuby /usr/bin/ruby
** /etc/apache2/mods-enabled/passenger.load **
LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.0/ext/apache2/mod_passenger.so
Let me know if you want to see anything else. I installed everything with sudo, all my rubygems directories, ruby directories, application directories are chmod 755 so www-data should have access correct? I've tried setting GEM_HOME to both rubygems paths and making sure the rails gem is in there too.
Help this is killing me!
Update:
gem list for test server (which works fine)
abstract (1.0.0)
actionmailer (3.0.0, 2.3.8, 2.3.5)
actionpack (3.0.0, 2.3.8, 2.3.5)
activemodel (3.0.0)
activerecord (3.0.0, 2.3.8, 2.3.5)
activeresource (3.0.0, 2.3.8, 2.3.5)
activesupport (3.0.0, 2.3.8, 2.3.5)
acts_as_audited (1.1.1)
arel (1.0.1)
authlogic (2.1.6)
builder (2.1.2)
bundler (1.0.0)
cancan (1.3.4)
cgi_multipart_eof_fix (2.5.0)
daemon_controller (0.2.5)
daemons (1.1.0)
dbi (0.4.5)
deprecated (2.0.1)
erubis (2.6.6)
fastthread (1.0.7)
file-tail (1.0.5)
gem_plugin (0.2.3)
mail (2.2.5)
mime-types (1.16)
mongrel (1.1.5)
mongrel_cluster (1.0.5)
mysql (2.8.1)
passenger (3.0.0)
polyglot (0.3.1)
rack (1.2.1, 1.1.0, 1.0.1)
rack-mount (0.6.13)
rack-test (0.5.4)
rails (2.3.5)
railties (3.0.0)
rake (0.8.7)
spruz (0.2.2)
thor (0.14.0)
treetop (1.4.8)
tzinfo (0.3.23)
validates_date_time (1.0.0)
I pulled in a co-worker to take another look at this problem and we found this post to convert the misleading and unhelpful error listed in my original post into the actual error text. The root of the problem ended up coming from which versions of particular gems were installed and where they were installed. AFIAK I ended up needing rack version 1.0.0 and version 1.0.1.
So passing what I learned from this problem to others: If you get a "Missing the Rails X.X.X gem..." take a look at your boot.rb file and make the change explained in the link above. This will display the real problem, which seems to always be an incorrect version of some other gem causing the rails gem to fail it's load process.
Thanks to everyone who spent time looking into my original post!
Can you check apache for your ruby ? Look for
PassengerRuby /usr/bin/ruby
Its possible you have passenger looking at the wrong ruby (could be multiple installed in 2 directories)
I want to setup different rails versions with RVM. However, working with the SQLite gives problem.
First, doing
gem list -ra sqlite
gives
*** REMOTE GEMS ***
sqlite-foreigner (0.5.0)
sqlite-ruby (2.2.3 ruby mswin32, 2.2.2 ruby mswin32, 2.2.1 ruby mswin32, 2.2.0 ruby mswin32, 2.1.0 ruby mswin32, 2.0.3)
sqlite3 (0.1.1, 0.1.0, 0.0.8, 0.0.7, 0.0.6, 0.0.5, 0.0.4, 0.0.3, 0.0.2, 0.0.1, 0.0.0)
sqlite3-dotnet (3.7.2.1, 3.7.2.0)
sqlite3-ironruby (0.1.1, 0.1.0)
sqlite3-ruby (1.3.1 ruby x86-mingw32 x86-mswin32-60, 1.3.0 ruby x86-mingw32 x86-mswin32-60, 1.2.5 ruby x86-mingw32 x86-mswin32, 1.2.4, 1.2.3 ruby mswin32 x86-mingw32, 1.2.2 ruby mswin32, 1.2.1 ruby mswin32, 1.2.0 ruby mswin32, 1.1.0 ruby mswin32, 1.0.1 ruby mswin32, 1.0.0 ruby mswin32, 0.9.0 ruby mswin32, 0.6.0, 0.5.0)
sqlitecache (0.0.1)
I am working with MacOS X 10.6, Sqlite3 3.7.2
Can I work with multiple versions of Sqlite3?
What gems would I need in my RVM environment?
Currently:
*** LOCAL GEMS ***
actionmailer (2.2.3, 2.2.2)
actionpack (2.2.3, 2.2.2)
activerecord (2.2.3, 2.2.2)
activeresource (2.2.3, 2.2.2)
activesupport (2.2.3, 2.2.2)
ffi (0.6.3)
haml (2.2.0)
rails (2.2.3, 2.2.2)
rake (0.8.7)
ruby-openid (2.0.4)
And RVM list:
rvm rubies
ree-1.8.6-20090610 [ x86_64 ]
=> ruby-1.8.6-p399 [ x86_64 ]
ruby-1.9.2-p0 [ x86_64 ]
you can install multiple sqlite3 packages simultaneously with gem. and you can select the specific gem version with the following lines:
require 'rubygems'
gem 'sqlite3', '=0.1.0'
require 'sqlite3'
To install it type:
gem install sqlite3 -v '0.1.0'
I think you can use any sqlite3 gem with any RVM, but you can check their webpage