I am trying to run the Rails app 'Simpsons by the Data' (source: https://github.com/toddwschneider/flim-springfield) however whenever I try to run the command bundle exec rake import_data
the following error is returned:
Called from /Users/XXXX/.rvm/gems/ruby-2.3.8/gems/activesupport-4.2.11/lib/active_support/dependencies.rb:240:in 'load_dependency'
rake aborted!
ArgumentError: invalid date
/Users/XXXX/flim-springfield/app/models/episode.rb:52:in 'parse'
I have PostgreSQL 11.1 on MacOS X installed and I have changed the date style from ISO, MDY to ISO DMY as I stupidly thought this would help but it didn't work.
This is my Gem file:
*** LOCAL GEMS ***
bigdecimal (default: 1.3.0)
bundler (2.0.1, default: 1.17.3)
bundler-unload (1.0.2)
did_you_mean (1.1.0)
executable-hooks (1.6.0)
gem-wrappers (1.4.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.2)
pg (1.1.4)
power_assert (0.4.1)
psych (default: 2.2.2)
rake (12.3.2, 12.3.1, 12.0.0)
rdoc (default: 5.0.0)
rubygems-bundler (1.4.5)
rvm (1.11.3.9)
test-unit (3.2.3)
xmlrpc (0.2.1)
Has anyone else run into a problem like this while using this Rails app or could even point me in the right direction? I am completely new to this and as this is the first Rails app that I have ever run, I am not sure how to progress. :(
Any help would be really appreciated!
Related
i have an old rails project here running rails 2.3.8 and ruby 1.8.7 with rvm.
when i'm running rake -T or another rake task it will fail with
I18n::UnknownFileType: can not load translations from /home/project/trunk/vendor/rails/activesupport/lib/active_support/locale/en.yml, the file type yml is not known
running some YAML in the console, will work.
i found some solutions for rails 3 and ruby 1.9.3 (Rails 3: 'The file type yml is not known' when trying to access basic _form.html.erb) and rails 2.3 with ruby 2 (Rails legacy app and Ruby 2 error: can not load translations from the file type yml is not known) but didnt help.
my Gems used in this project:
actionmailer (2.3.18)
actionpack (2.3.18)
activerecord (2.3.18)
activeresource (2.3.18)
activesupport (2.3.18)
afm (0.2.2)
Ascii85 (1.0.2)
bundler-unload (1.0.2)
color (1.8)
executable-hooks (1.3.2)
gem-wrappers (1.2.7)
hashery (2.1.1)
iconv (1.0.4)
little-plugger (1.1.4)
logging (2.0.0, 1.8.2)
multi_json (1.11.2)
mysql (2.9.1)
pdf-core (0.6.0)
pdf-reader (1.3.3)
pdf-writer (1.1.8)
prawn (2.0.2, 0.12.0)
rack (1.1.6)
rails (2.3.18)
rake (10.4.2, 10.1.1)
ruby-rc4 (0.1.5)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
transaction-simple (1.4.0.2)
ttfunk (1.4.0, 1.0.3)
script/console and script/server running fine.
i have to use ruby 1.8.7 and cannot update. upgrade to rails 3 is'nt possible in month's :)
do you have some idea's to get the rake tasks running?
best
robert
i found the solution:
there was several problems:
rake (10.4.2, 10.1.1) now just using rake 10.1.1
logging (2.0.0, 1.8.2) now just using logging 1.8.2
(after testing) had to replace rdoctask with task in Rakefile
now rake -T works fine
This is an update for the problem mentioned below:
I just found out that there is a Gemfile and Gemfile.lock in the root directory i.e system Home directory, and when ever i create a new gemset i believe it uses this gemfile. After installing rails in a newly created gemset, when check the rails version or try to create a new app, it shows the error Your ruby version is 2.2.0, but your Gemfile specifies 2.1.5, cause the Gemfile file in my home directory contains that ruby version, and if delete that Gemfile, and try to create a new rails app, it searches for that Gemfile.
I am current going through a hard time. I was starting a new project in ruby 2.2.0 and rails 4.2.0 and started by creating a gemset using RVM inside my project folder.
created gemset.
$rvm use ruby-2.2.0#myapp --ruby-version --create
Installed latest rails
$gem install rails
After that i checked the rails version just to verify
$rails -v
but instead i get a notification saying Your Ruby version in 2.2.0 but your Gemfile specified 2.1.5. I also don't have my application folder yet, cause i get the same output if i try to $rails new .
Following are the RVM related outputs
My RVM version is 1.26.10.
rvm gemset list
gemsets for ruby-2.2.0 (found in /Users/samy/.rvm/gems/ruby-2.2.0)
(default)
global
student-portal
=> myapp
gem list for global gemset
bigdecimal (1.2.7, 1.2.6)
bundler (1.7.13)
bundler-unload (1.0.2)
executable-hooks (1.3.2)
gem-wrappers (1.2.7)
io-console (0.4.3)
json (1.8.2, 1.8.1)
mini_portile (0.6.2)
minitest (5.5.1, 5.4.3)
nokogiri (1.6.6.2)
power_assert (0.2.2)
psych (2.0.12, 2.0.8)
rake (10.4.2)
rdoc (4.2.0)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
test-unit (3.0.9, 3.0.8)
gem list for myapp gemset
actionmailer (4.2.0)
actionpack (4.2.0)
actionview (4.2.0)
activejob (4.2.0)
activemodel (4.2.0)
activerecord (4.2.0)
activesupport (4.2.0)
arel (6.0.0)
bigdecimal (1.2.7, 1.2.6)
builder (3.2.2)
bundler (1.7.13)
bundler-unload (1.0.2)
erubis (2.7.0)
executable-hooks (1.3.2)
gem-wrappers (1.2.7)
globalid (0.3.2)
hike (1.2.3)
i18n (0.7.0)
io-console (0.4.3)
json (1.8.2, 1.8.1)
loofah (2.0.1)
mail (2.6.3)
mime-types (2.4.3)
mini_portile (0.6.2)
minitest (5.5.1, 5.4.3)
multi_json (1.10.1)
nokogiri (1.6.6.2)
power_assert (0.2.2)
psych (2.0.12, 2.0.8)
rack (1.6.0)
rack-test (0.6.3)
rails (4.2.0)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.5)
rails-html-sanitizer (1.0.1)
railties (4.2.0)
rake (10.4.2)
rdoc (4.2.0)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
sprockets (2.12.3)
sprockets-rails (2.2.4)
test-unit (3.0.9, 3.0.8)
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
tzinfo (1.2.2)
which ruby gives
/Users/samy/.rvm/rubies/ruby-2.2.0/bin/ruby
which rails gives
/Users/samy/.rvm/gems/ruby-2.2.0#myapp/bin/rails
the file contains
#!/usr/bin/env ruby_executable_hooks
#
# This file was generated by RubyGems.
#
# The application 'railties' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0"
if ARGV.first
str = ARGV.first
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
version = $1
ARGV.shift
end
end
gem 'railties', version
load Gem.bin_path('railties', 'rails', version)
I tried removing and reinstalling RVM but i did not work.
Also i tried making app with ruby 2.1.5 with different gemset and all, but there i get different error when i try to do rails new app. i get the Could not find slop-3.6.0 in any of the sources
Run 'bundle install' to install missing gems., but once i do the bundle install i cannot run the rails new app command as it notifies
Can't initialize a new Rails application within the directory
of another, please change to a non-Rails directory first.
Any help would be greatly appreciated. If you need any more info i am ready to provide it.
Thanks in advance.
Cheers.
I had similar issues and restarting from scratch using this guide helped a lot. Though it seemed yet another guide, I found it to be a bit more systematic and detailed than the others.
Rails Apps Guide: Install Ruby on Rails ยท Ubuntu Linux
Alternatively, try Rails Apps Guide: Updating to Rails 4.2
Note:
Rails is not just a Ruby gem, it is a complex and rapidly evolving
ecosystem. It is important to set up your development environment with
the most current version of all the gems that are needed for
development.
I have got a error when I try to use my ruby on rails application. The error i got:
in `require': No such file to load -- spreadsheet (LoadError)
My gem list:
bundler (1.3.5)
bundler-unload (1.0.2)
executable-hooks (1.2.6)
mini_portile (0.5.2)
rake (10.1.0)
ruby-ole (1.2.11.7)
rubygems-bundler (1.4.2)
rubygems-update (2.1.11)
rubyzip (1.1.0)
rubyzip2 (2.0.2)
rvm (1.11.3.8)
spreadsheet (0.9.6)
On my local environment it works. In production it doesn't work.
Could someone help me with that?
I did, gem install passenger, passenger-install-apache2-module
http://localhost/
I'm getting this error.
http://pastebin.com/YfrEsv3X
Update
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.8)
actionpack (3.0.8)
activemodel (3.0.8)
activerecord (3.0.8)
activeresource (3.0.8)
activesupport (3.0.8)
arel (2.1.1, 2.0.10)
bcrypt-ruby (2.1.4)
builder (3.0.0, 2.1.2)
bundle (0.0.1)
bundler (1.0.15)
daemon_controller (0.2.6)
devise (1.3.4)
erubis (2.7.0, 2.6.6)
fastthread (1.0.7)
i18n (0.6.0, 0.5.0)
mail (2.3.0, 2.2.19)
mime-types (1.16)
mysql (2.8.1)
mysql2 (0.3.2)
orm_adapter (0.0.5)
passenger (3.0.7)
pg (0.11.0)
polyglot (0.3.1)
postgres-pr (0.6.3)
rack (1.3.0, 1.2.3)
rack-mount (0.8.1, 0.6.14)
rack-test (0.6.0, 0.5.7)
rails (3.0.8)
railties (3.0.8)
rake (0.9.2, 0.8.7)
rubygems-update (1.8.5)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.27)
warden (1.0.4)
You need to install the bundler gem as well.
Update
Now that the OP has posted his gemset...
You must have two gemsets, usually this is because you're using two different rubys. The gem command is just a script, with a shebang line pointing to a Ruby. The gem list you're showing will be the gemset for that Ruby. You can see this with this command: head -1 $(which gem)
Your passenger configuration must be pointing to a different Ruby with a different gemset. You can see this in your passenger.conf lines for Apache.
I suspect after installing the bundler gem - you may experience other problems if your Gemfile doesn't include all the gems your project requires.
So next time - look at the error message.
no such file to load -- bundler
from the above example - you can notice that 'bundler' is causing the problem.
That will give you a clue as what other gems you'd need to install and possibly missed out in your Gemfile - in which case issue the command:
gem install <missing-gem>
Here's my error message when I do a DB rake:
Could not find gem 'sqlite3 (>= 0)' in
any of the gem sources listed in your
Gemfile.
I've tried Installing xCode 4.0.2
Commands:
sudo gem install sqlite3-ruby
sudo gem update --system
sudo gem update rails
sudo gem update sqlite3-ruby
Gem list produces:
abstract (1.0.0)
actionmailer (3.0.8, 2.2.2)
actionpack (3.0.8, 2.2.2)
activemodel (3.0.8)
activerecord (3.0.8, 2.2.2)
activeresource (3.0.8, 2.2.2)
activesupport (3.0.8, 3.0.6, 2.2.2)
arel (2.0.10)
builder (2.1.2)
bundler (1.0.14)
erubis (2.6.6)
i18n (0.5.0)
mail (2.2.19)
mime-types (1.16)
polyglot (0.3.1)
rack (1.2.3)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.8, 2.2.2)
railties (3.0.8)
rake (0.9.2, 0.8.3)
rubygems-update (1.8.5, 1.8.4, 1.3.1)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.27)
Any suggestions? I'm on Max OS X 10.6
I think it will work if you add sqlite to your Gemfile:
gem 'sqlite3'
And run:
$ bundle update
I solved this by doing:
sudo gem i sqlite3
If you check the man via:
gem help commands
The "i" stands for install, sort of a short cut. Doing this after running the bundle update & all the core updates cased Ruby's rake to work.
Thanks for your help!