I was in the midst of Ruby on Rails coding, having run several rails generate methods over the last hour, when suddenly a new generate command threw up an error message. A similar error came when I tried to run my tests via rake. And then on the command line for just "rails". And then the same error for the "gem" command.
So I presume, somehow, I have broken my "rubygems" Gem file ? Which is worrying, as I was coding in Rubymine and, well frankly, nowhere near it !
Can anyone help explain what might have happened, and what the best fix might be ? For now, I'll try reinstalling Ruby, but that's a costly workaround I'd like to avoid doing more than once.
The error stacktrace looks as follows :
C:\Users\Ben>rails
C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127:in `load_gems_in':
private method `load' called for Gem::Specification:Class (NoMethodError)
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/deprecate.rb:38:in `skip_during'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:126:in `load_gems_in'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:125:in `each'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:125:in `load_gems_in'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:122:in `reverse_each'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:122:in `load_gems_in'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:321:in `refresh!'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:97:in `initialize'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:1051:in `new'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:1051:in `source_index'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:243:in `activate_dep'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:236:in `activate'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:1307:in `gem'
from C:/dev/lang/Ruby187/bin/rails:18
My Gem file (for the project above) is:
source 'http://rubygems.org'
gem 'rails', '3.0.7'
gem 'sqlite3'
gem "jquery-rails"
Although the error occurs at all command line instances.
[EDIT] at this stage I have fully reinstalled ruby and rails and the problem has gone. I have kept the old installation directory though, in case we can get to the bottom of this issue, or in case it reoccurs !
[SECOND EDIT]New installation, after a machine reboot, gem has once more started failing, and RubyMine is saying it can't find any gems (even rubygems) :
C:\Users\Ben>gem
C:/dev/lang/Ruby187/lib/ruby/1.8/optparse.rb:1433:in `private': undefined method `search' for class `OptionParser' (NameError)
from C:/dev/lang/Ruby187/lib/ruby/1.8/optparse.rb:1433
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/command.rb:7
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:7
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:7
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from C:/dev/lang/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from C:/dev/lang/Ruby187/bin/gem:9
Maybe RubyMine is screwing up the install ? Or Windows 7 ? Never has a problem with my core development language getting corrupted - very frustrating !
My hunch was correct - RubyMine was to blame... and the user too, of course !
Far too used to using refactoring tools in Intellij for Java, I refactored some fairly common methods names in my controllers (such as changing "show" to "index") and ended up refactoring into the Ruby 1.8 standard library files too !
Need to double-check what refactoring is doing, going forward, and try to limit it just to my project and not the whole SDK :)
Related
I've trawled every possible Ruby resource looking for a solution to this error but can't for the life of me figure out what I'm doing wrong.
I'm trying to get my sass compiler working for a Drupal build from a previous project. Using the following stack: Ruby 2.3.0, Sass 3.4.22, Compass & Compass Core 1.0.3, Bundler 1.11.2. I've already tried uninstalling and reinstalling the gems but to no avail.
The error occurs when I run the bundle exec compass watch command, which results in the following output:
LoadError on line ["179"] of /Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-core-1.0.3/lib/compass/configuration/data.rb: cannot load such file -- breakpoint
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-core-1.0.3/lib/compass/configuration/data.rb:179:in `require'
/Users/somedude/Sites/devdesktop/taronga-dev/docroot/sites/tarongazoo/themes/custom/taronga/config.rb:9:in `get_binding'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/configuration/serialization.rb:24:in `eval'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/configuration/serialization.rb:24:in `parse_string'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/configuration/serialization.rb:15:in `block in _parse'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/configuration/serialization.rb:14:in `open'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/configuration/serialization.rb:14:in `_parse'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/configuration/file_data.rb:7:in `block in new_from_file'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-core-1.0.3/lib/compass/configuration/inheritance.rb:207:in `with_defaults'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/configuration/file_data.rb:6:in `new_from_file'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/configuration/helpers.rb:19:in `configuration_for'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/configuration/helpers.rb:69:in `add_project_configuration'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/commands/project_base.rb:37:in `add_project_configuration'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/commands/project_base.rb:25:in `configure!'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/commands/project_base.rb:15:in `initialize'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/commands/update_project.rb:41:in `initialize'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/exec/sub_command_ui.rb:42:in `new'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/exec/sub_command_ui.rb:42:in `perform!'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/lib/compass/exec/sub_command_ui.rb:15:in `run!'
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/bin/compass:30:in `block in '
/Users/somedude/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/bin/compass:44:in `'
/Users/somedude/.rvm/gems/ruby-2.3.0/bin/compass:23:in `load'
/Users/somedude/.rvm/gems/ruby-2.3.0/bin/compass:23:in `'
/Users/somedude/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/Users/somedude/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `'
Has anyone else encountered something similar when trying to get their SASS compiler to run? ANY help would be much appreciated.
Thanks,
Mark.
Resolved! It was such a simple oversight.
It turns out I just needed to call the missing gems via my Gemfile:
gem 'compass'
gem 'sass'
gem 'sass-globbing'
gem 'breakpoint'
There were also a few version conflicts, but these were resolved by reinstalling gems by specific version, for example:
gem install breakpoint -v 2.5.0
Hopefully this points anyone else having similar issues in the right direction.
Cheers.
Dependencies should automatically be installed, but you could try manually installing the breakpoint gem that it can't find:
gem install breakpoint
Recently came back to a computer (Mac OS X Lion 10.7) with which I've had repeated environment issues, started a new rails app, and ran
rake db:create
I got this error output (with --trace):
rake aborted!
dlopen(/Users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/pg-0.15.1/lib/pg_ext.bundle, 9): Library not loaded: /usr/lib/libpq.5.dylib
Referenced from: /Users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/pg-0.15.1/lib/pg_ext.bundle
Reason: image not found - /Users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/pg-0.15.1/lib/pg_ext.bundle
/Users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/pg-0.15.1/lib/pg.rb:4:in `require'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/pg-0.15.1/lib/pg.rb:4:in `<top (required)>'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/Users/<username>/rails/<appname>/config/application.rb:7:in `<top (required)>'
/Users/<username>/rails/<appname>/Rakefile:4:in `require'
/Users/<username>/rails/<appname>/Rakefile:4:in `<top (required)>'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195#global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195#global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195#global/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195#global/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195#global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195#global/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195#global/gems/rake-10.1.0/lib/rake/application.rb:77:in `block in run'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195#global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/<username>/.rvm/gems/ruby-2.0.0-p195#global/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
bin/rake:4:in `<main>'
config/application.rb:7 refers to:
Bundler.require(:default, Rails.env)
This comes on the heals of a couple environment issues that are, I'm sure, causing the issue, but I don't know how. Basically, I was having issues with homebrew (brew install wget wouldn't work, complaining it was already downloaded, but then saying:
checking for libssl... no
configure: error: --with-ssl=openssl was given, but SSL is not available
So I uninstalled homebrew, uninstalled my shell (fish shell), reinstalled both, and tried to start things from scratch. Probably not a great idea, in retrospect. I seem to have messed things up worse than they already were.
brew doctor seems to think most things are OK, though. The only thing that jumps out at me as possibly related is:
/Users/sasha/.rvm/bin/pkg-config
(There's another thing brought up -- "/usr/bin occurs before /usr/local/bin", but this only applies to the node, npm, and gcov-4.2 installs, which don't seem relevant to this Rails issue.)
And I think RVM is supposed to have its own pkg-config install, right?
At any rate, OpenSSL is installed and updated by homebrew, and looking good (it shows up in brew list). Also, my XCode Command Line Tools is up to date as well.
I guess my question is if anyone has any idea what's going on? I've tried reordering my path to comply with brew doctor, un/reinstalling lots of things, updating everything, etc, and this just won't go away. Super frustrating, cause I basically can't do anything without rake working. And I think this dylib and openssl issue might be interrelated, so I figured I'd just dump all this data here.
Any ideas? I'd really appreciate help.
Thanks!
EDIT -- This is using Rails 4.0, with the pg gem.
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0.rc1'
# Use postgresql as the database for Active Record
gem 'pg'
if that makes any difference.
UPDATE -- Seems to be related to this problem, which I'm also having. I think rake is not working because of pg, which isn't working because of crpyto/openssl.
The problem was based on an inexplicably empty libssl.dylib file. There was a backup (libssl.dylib.BAK), and I just overwrote the empty file with it and -- poof -- all the problems went away. No idea how that happened in the first place, but if anyone's having similar problems, I'd look for .BAK files in usr/lib/ and (if there are any) see if the associated files are empty.
I work on windows, have rails 3.2.12(just upgraded) and ruby 2.0.0p0. when i try to delete a controller i get this error:
F:\my apps\meshworks-redo> rails d controller Plans
C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/pg-0.14.1-x86-mingw32/lib/pg.rb:10:in `require': cannot load such file -- 2.0/pg_ext (LoadError)
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/pg-0.14.1-x86-mingw32/lib/pg.rb:10:in `rescue in <top (required)>'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/pg-0.14.1-x86-mingw32/lib/pg.rb:3:in `<top (required)>'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runtime.rb:72:in `require'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runtime.rb:70:in `each'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runtime.rb:70:in `block in require'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runtime.rb:59:in `each'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler/runtime.rb:59:in `require'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.2/lib/bundler.rb:132:in `require'
from F:/my apps/meshworks-redo/config/application.rb:7:in `<top (required)>'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:24:in `require'
from C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:24:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I tried re installing the pg gem, no luck.
A friend of mine got the same problem when using Ruby 2.0 on Windows 7 with Postgres. It occurs not only when trying to destroy a controller, but for every database action (including rake db:create). The problem is that the pg_ext.so file is not included for ruby 2.0. It is included for 1.9, but simply copying this to the 2.0 does not seem work. However, I found another method to obtain the correct pg_ext.so. Not exactly sure why this works, but it works for him. Here is what you need to do:
Go to the folder where 2.0/pg_ext.so (the file that could not be found) should be located. In your case C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/pg-0.14.1-x86-mingw32/lib/.
Create a folder called '2.0' (without the quotes) here.
In this folder you will need the correct pg_ext.so file. You can obtain this in the following way:
Manually install the pg gem ("gem install pg" in console). This installs the non x86-mingw32 version of the gem. It does not fix the problem, but it does create the correct pg_ext.so. I think this is because it compiles the pg gem for your system, so for ruby 2.0. You can then use this pg_ext.so file with the pg x86-mingw32 version. You will need DevKit in order to compile and install pg (http://rubyinstaller.org/add-ons/devkit/).
Go to the location of pg_ext.so in the pg-0.14.1 gem folder. In your case this would be C:/Users/rrw/.pik/rubies/Ruby-200-p0/lib/ruby/gems/2.0.0/gems/pg-0.14.1/lib.
Copy the file pg_ext.so from this folder to the newly pg-0.14.1-x86-mingw32/lib/2.0/ folder in step 2.
Now retry your commands and check if everything works. If it does not, delete your Gemfile.lock and re-run bundle install.
The same problem with this gem might occur with other mingw32 gems as well. IFor example, I had the same problem with the bcrypt-rails gem. Following the same steps as described above fixed the problem. I am now successfully running Ruby 2.0 on Windows 7.
Ps. If you have any other problems running the pg gem on Windows 7 64 bit, then try to install the 32 bit x86 version of Ruby (the RubyInstaller) and postgresql. Furthermore, make sure you include the Ruby folders in your path (this is an option while installing ruby 2.0 using the RubyInstaller) as well as the Postgresql lib and bin folders.
Good luck!
I am very very very new to RoR and I'm doing this on my windows 7 environment.
Yeah I know, "why not ubuntu?" We tried..performance was dog slow.
Anyway, I have RoR running on my machine and I created a test app aptly named, "testApp".
I run it in the browser..voila! No biggie. I have my basic website.
Now when I try and run it with a checked out website on my desktop, I get this
C:\devApp>ruby script/server
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:in `requirement': undefined local variable or method `version_requirements' for
#<Rails::GemDependency:0x35eae38> (NameError)
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems.rb:254:in `activate'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems.rb:1204:in `gem'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/gem_dependency.rb:73:in `add_load_paths'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:301:in `block in add_gem_load_paths'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:301:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:132:in `process'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
from C:/srw/config/environment.rb:12:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/commands/server.rb:84:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from script/server:3:in `<main>'
And no server is started. I've gone through all my gems to make sure I have the right versions as per my lead developer tells me. And we both are scratching our heads now.
Can someone help me figure out what dependency I'm missing?
Thanks!
I think this is happening because your RubyGems version is out of date. Try running gem update --system to update it to the latest version
Just update your bundler, maybe of any-one of the older gem is conflicting with latest one, this type of issues arises.
'gem install bundler'
and then 'bundler install'
If you find again error, then delete GEM.lock file, then run bundler install. It may resolve the issue.
Seems like you are trying to run an application without all the required gems, I would try installing all the gems that are mentioned in the "Gemfile" (root of the app), and running the application again.
As a Windows user, I would really suggest that you try to do your rails learning and development in Ubuntu (like I do). It is much easier to install, mantain, test applications and get help.
I'm trying to generate model diagrams using the railroad gem. I have managed to generate a diagram for a different app, but I'm trying to get my head around some "legacy" code, and keep running into problems.
I know very little about ruby or rails, so any help would be appreciated...
Basically, I run:
$ railroad -v -M
and get:
Loading application environment
Loading application classes
./config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/core_ext/string/access.rb:43:in `first': undefined method `[]' for #<Enumerable::Enumerator:0xb70a72d0> (NoMethodError)
from ./config/../vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:70:in `has_attachment'
from ./app/models/asset.rb:5
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from ./config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in `require'
from ./config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
from ./config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in `require'
from /home/myname/.gem/ruby/1.8/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:40:in `load_classes'
from /home/myname/.gem/ruby/1.8/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:40:in `each'
from /home/myname/.gem/ruby/1.8/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:40:in `load_classes'
from /home/myname/.gem/ruby/1.8/gems/railroad-0.5.0/lib/railroad/app_diagram.rb:21:in `initialize'
from /home/myname/.gem/ruby/1.8/gems/railroad-0.5.0/lib/railroad/models_diagram.rb:14:in `initialize'
from /home/myname/.gem/ruby/1.8/gems/railroad-0.5.0/bin/railroad:36:in `new'
from /home/myname/.gem/ruby/1.8/gems/railroad-0.5.0/bin/railroad:36
from /home/myname/.gem/ruby/1.8/bin/railroad:19:in `load'
from /home/myname/.gem/ruby/1.8/bin/railroad:19
I've tried reinstalling attachment_fu (it was already in the vendor/plugins folder) but that didn't seem to help.
I wouldn't be surprised if there was a problem with the schema - I've already had to fix typos in column names, missing references, that kind of thing. Is there anyway I can work out where it might be dying?
Thanks a lot!
Your version of Ruby, probably 1.8.7 or even more recent, is too modern for attachment_fu. To fix this, you need to change attachment_fu itself. Edit the file vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb and on line 66 change:
options[:path_prefix].first == '/'
(at the end) to
options[:path_prefix].starts_with? == '/'
Alternatives are to downgrade your version of Ruby to 1.8.6 (probably, perhaps even lower) or use a different plugin. Attachment_fu is not supported any longer. Paperclip is used these days.
This error is described in more detail here.