I using the rails by Instantrails on windows.It can run well before I update the rails version to rails 3 .
The error message is :
E:\InstantRails-2.0-win\rails_apps\myproject>rails server
E:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/lo
ckfile_parser.rb:48:in parse_source': undefined method[]' for nil:NilClass (N
oMethodError)
from E:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/l
ib/bundler/lockfile_parser.rb:20:in send'
from E:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/l
ib/bundler/lockfile_parser.rb:20:ininitialize'
from E:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/l
ib/bundler/lockfile_parser.rb:14:in each'
from E:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/l
ib/bundler/lockfile_parser.rb:14:ininitialize'
from E:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/l
ib/bundler/definition.rb:43:in new'
from E:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/l
ib/bundler/definition.rb:43:ininitialize'
What cause this error?
I found that answer,because the old version project can't run on the new version.
You're troubling the trouble by using a legacy environment like InstantRails for rails3.
InstantRails hasn't been updated for nearly 3 years and its latest version includes ruby 1.8.6 which is incomplatible with rails 3.
From the official Ruby on Rails website:
We recommend Ruby 1.8.7 or Ruby 1.9.2 for use with Rails. Ruby 1.8.6 and earlier are not supported, neither is version 1.9.1
If you really insist on using windows as a development environment, the recommended way of getting rails 3 to work on Windows right now is to install ruby via the Windows installer: http://rubyforge.org/frs/?group_id=167 and then just install RubyGems by running its installation script and afterwards install rails3 as gem.
Related
I have almost finished my first Ruby on Rails application, i have used Ruby 2.1.2 and Rails 4.2.4.. then i want to deploy it, the hosting i took gave me 1month trial but they have installed CPanel 11 (it has rails 2.3.18 by default)
but when i try to install the rails 4.2.4 gem it gives me this:
> Error installing rails: i18n requires Ruby version >= 1.9.3.
My questions are:
Is there a way to update the ruby?
Would i have any trouble if they just update to 1.9.3 when i have used 2.1.2?
this is a screenshot from the gems in the cpanel
Recently I had to upgrade my Ruby version to a higher one and I was in a very similar situation like yours.
I used rvm for this.
Use rvm for listing the ruby version with the following command:
rvm list known
Then upgrade ruby with: rvm install version_of_your_choice
Also, search the internet for tutorials. StackOverflow has all the answers.
I have an RoR app built previously with Ruby 1.9.3 and rails 3.0.1. I have deployed to Heroku previously with this setup. If I would like to use Ruby 2.1.2 on my new computer, when accessing the app code and trying to deploy again on Heroku will my app encounter problems because of the different Ruby versions?
According to this compatibility matrix, you will need a Ruby version 2.x.
Rails Version Possible Ruby Versions Recommended Ruby Version
1.0–2.1 1.8.6 1.8.6
2.2 1.8.6 or 1.8.7 1.8.7
2.3 1.8.6, 1.8.7, or 1.9.1 1.8.7
3.0–3.2 1.8.7, 1.9.2, or 1.9.3 1.9.3
4.0–… 1.9.3, 2.0.x 2.0.x
I am trying to install a rails 1.2.3 app on my machine. My machine is currently using rails 3.2.6 , ruby 1.9.3 and windows 7. While trying to use 'RAKE', I am getting the following error
WARNING: 'require 'rake/rdoctask'' is deprecated.
Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
How shall I figure out the problem in order to be able to use my application.
In your Rakefile you should change the require statements as rake demands it. There might be follow up errors so it would be best to update Rake to match your rails version.
I have a rails application that I am trying to deploy onto the internet. I have setup a server on the Amazon EC2 cloud, that I know works because I have deployed another site to the same machine.
When I try to run this new application either through 'rails console' or when running 'rake db:seed' or just by trying to browse to the application, rails crashes saying it cannot find activiesupport:
/home/ec2-user/.gem/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/core_ext/big_decimal/conversions.rb:1:in `require': cannot load such file -- bigdecimal (LoadError)
My Rails version is 3.2.2 and I'm using ruby 1.9.3p0 (2011-10-30) [x86_64-linux]. My database is MongoDB which I access through Mongoid. And I'm using Passenger and Apache as a server.
Is there any configuration step or something like that that I have missed?
P.S. I know I shouldn't be using ec2-user, I'm still experimenting. And also, I've never had much luck with RVM.
I encountered the same problem with Rails 3.2.3 and Ruby 1.9.3p0 on my Amazon EC2 instance, where Ruby had been installed with the ruby19 yum package. In my case, the problem seemed to be that I had installed the bigdecimal gem manually using the gem command instead of using Bundler. To fix the problem, I uninstalled the gem manually, added the line
gem 'bigdecimal'
to my application's Gemfile, and re-ran bundle install. This reinstalled the gem and then my application was able to load it successfully.
My gems are also installed in ~/.gem/ruby/1.9.1/, even though I am running Ruby 1.9.3p0. This does not appear to be a problem.
I have a legacy project using Rails 2.3.5 but I can't find with which version of JRuby it was running. Warble has been used to create a war file. So the only thing I see is:
rack-1.0.1.gemspec
rails-2.3.5.gemspec
rake-0.8.7.gemspec
Is there a way to know which version of JRuby was used?
Yes, there actually is - warbler "embeds" JRuby, just take a loot inside the archive: .war/WEB-INF/lib/jruby-core-x.x.x.jar (or jruby-stdlib-x.x.x.jar) where x.x.x corresponds to the ruby version used when the war is deployed e.g. "1.5.6"
Rails 2.3.x series were compatible with Ruby 1.8.7 thus you should be fine with the latest JRuby (1.6.7) anyway - as it is 1.8.7 compatible :
jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM) Server VM 1.6.0_24) [linux-i386-java]