Ruby1.8 Rails2.3 ./script/server producing error - ruby-on-rails

I have been assigned a projected that was written in Ruby1.8 and Rails2.3. We can't upgrade at the moment. I have successfully installed ruby and rails and installed all needed gems for the project on a ubuntu machine. I have received success messages while installing everything.
However, when I run the command ./script/server I received the output:
/var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require': no such file to load -- sentry (MissingSourceFile)
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /home/robotmaster/Documents/Source/agile/config/initializers/sentry.rb:1
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load_without_new_constant_marking'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:622:in `load_application_initializers'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:621:in `each'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:621:in `load_application_initializers'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:176:in `process'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:113:in `send'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:113:in `run'
from /home/robotmaster/Documents/Source/agile/config/environment.rb:42
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/commands/server.rb:84
from ./script/server:4:in `require'
from ./script/server:4
I am new to the Rails and would appreciate any help with this error message. Thanks

The key to the issue is here:
sentry (MissingSourceFile)
I'm really not familiar with that particular file (and Rail 2.3 is several major revisions behind...) but it indicates to me that there's something incomplete about your Gem set.
gem update
This would be my first attempt. Verify that all of the referenced gems in your Gemfile are present on the system. If at all possible, I'd really look to upgrade to at least Rail 3, preferably 4.
EDIT:
Reading this again, why are you executing ./script/server? You should be executing:
rails s

Related

When I try the command rails server on a new project I get this error

I am running Debian 7. I am using RVM. I am also running mySQL. I am new to ruby in general as well as rails. Please excuse any of me if I seem naive at all.
I setup a project with:
rails new projectname -d mysql
Then I went into that directory and ran:
rails server
I then get this error:
/home/user/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.0/lib/execjs.rb:5:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.0/lib/execjs.rb:4:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/user/htdocs/simple_cms/config/application.rb:7:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:53:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:53:in `block in '
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:50:in `tap'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:50:in `'
from script/rails:6:in `require'
from script/rails:6:in `'
I went to the link that was provided: https://github.com/sstephenson/execjs
The Read Me under Install says:
gem install execjs
I do this and still get the same error. I am lost.
You have to first install a Javascript runtime, such as Node.js.
For Debian, there's installation instructions on Node.js Github
Edit: The ExecJS README lists the supported Javascript runtimes.
I did install therubyracer. I put the necessary gems insides the projects gem file. This seems to have solved this issue.

Does TinyTDS support Ruby 2.0.0?

I am having real trouble trying to get TinyTDS working with Ruby 2.0.0 on Windows 7.
When i run a rails c (or require tiny_tds from an irb), i get the following:
D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- tiny_tds/tiny_tds (LoadError)
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/tiny_tds-0.5.1-x86-mingw32/lib/tiny_tds.rb:16:in `rescue in <top (required)>'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/tiny_tds-0.5.1-x86-mingw32/lib/tiny_tds.rb:12:in `<top (required)>'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from S:/code/user/app/ruby2_test/config/application.rb:7:in `<top (required)>'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:39:in `require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I have tried installing the latest version of the gem:
gem install tiny_tds --pre
And looking inside:
D:\Ruby\Ruby200\lib\ruby\gems\2.0.0\gems\tiny_tds-0.6.0.rc1-x86-mingw32\lib\tiny_tds
I can see there is no 2.0 directory, which leads me to believe version 2.0 isn't supported. However i can see no mention on the TinyTDS github or any other sites about this issue.
So, am i missing something or does TinyTDS currently just not work with Ruby 2.0?
Copying the answer from the comments in order to remove this question from the "Unanswered" filter:
I believe this is an issue with OS that you are using as another
individual had the same issue. As stated I believe this is a
dependency issue with Windows. Please see the comment from MetaSkills
- https://github.com/rails-sqlserver/tiny_tds/issues/110#issuecomment-15503928
~ answer per David

Deploy Rails program to Heroku under Fedora 15

[root#chris-notebook helloworld]# heroku create helloworld --stack cedar
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- readline (LoadError)
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/command/run.rb:1:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/command.rb:17:in `block in load'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/command.rb:16:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/command.rb:16:in `load'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/bin/heroku:13:in `<top (required)>'
from /usr/local/bin/heroku:19:in `load'
from /usr/local/bin/heroku:19:in `<main>'
When I try to create that, every time I got same error.
What should I do? I saw similar problems but under Ubuntu. They solve it by going some place ...src/ruby../ext/readline and then execute
ruby extconf.rb
make
make install
but I don't see that folder in file system. Why is it all so difficult?
Update
Solved by installing next packages
readline-devel.i686
readline-static.i686
And then making similar operations in the folder ext/readline that placed in downloaded sources of ruby.

problem on setting up ruby on rails

I just started learning ruby on rails with "Lynda Ruby on Rails 3 Essential Training".
I finished the installation, and created rails application by writing- "rails new app".
After that when I wrote - "rails server", that's what I saw:
C:\Users\Oded\sites\simple_cms>rails server
C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.r
b:2:in `require': 193: %1 is not a valid Win32 application. - C:/Ruby192/lib/r
uby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError
)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/my
sql2/mysql2.rb:2:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/my
sql2.rb:7:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/my
sql2.rb:7:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:64:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:64:in `block (2 levels) in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:62:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:62:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:51:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runti
me.rb:51:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler.rb:11
2:in `require'
from C:/Users/Oded/sites/simple_cms/config/application.rb:7:in `<top (re
quired)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:28:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:28:in `block in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:27:in `tap'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/comman
ds.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Can you please help me find the solution?
Happy holidays,
Oded
Looks like you're missing some gems! try running bundle install... then all should work.
EDIT: make sure that your Gemfile contains the line
gem 'mysql'
before running bundle install. Bundler will get you set up for mysql, dependencies and all.
You have to go to this website and follow the directions ...
http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
or in short download the connector mentioned in the article from mysql or a mirror site
Run this command:
gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32
Make sure you have the correct path to the mysql connector folder that has no spaces!!
After that is complete make sure you copy the libmysql.dll file from the connector library you unzipped and downloaded and placed that in the Ruby\bin file.
After that delete the connector libary and start it up by typing 'rails server' making sure your gem file has the line gem 'mysql' or gem 'mysql2' I'm not sure which one so try both. It sucks and they really need to fix this for windows.

ImageMagick conflict on Ubuntu running webbrick

I am trying to install refinerycms, a Ruby on Rails CMS on Ubuntu 10.04 LTS. I run rails server and I get the following exception:
carcher#carcher-laptop:~/Code/tgc$ rails server
=> Booting WEBrick
=> Rails 3.0.0 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/lib/ruby/gems/1.8/gems/rmagick-2.12.2/lib/RMagick2.so: This installation of RMagick was configured with ImageMagick 6.6.4 but ImageMagick 6.5.7-8 is in use. (RuntimeError)
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/rmagick-2.12.2/lib/RMagick.rb:11
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/dragonfly-0.7.6/lib/dragonfly/analysis/r_magick_analyser.rb:1
from /usr/lib/ruby/gems/1.8/gems/dragonfly-0.7.6/lib/dragonfly/config/r_magick.rb:15:in `apply_configuration'
from /usr/lib/ruby/gems/1.8/gems/dragonfly-0.7.6/lib/dragonfly/configurable.rb:33:in `configure'
from /usr/lib/ruby/gems/1.8/gems/dragonfly-0.7.6/lib/dragonfly/config/r_magick.rb:14:in `apply_configuration'
from /usr/lib/ruby/gems/1.8/gems/dragonfly-0.7.6/lib/dragonfly/configurable.rb:39:in `configure_with'
from /usr/lib/ruby/gems/1.8/gems/refinerycms-0.9.8.2/vendor/refinerycms/images/lib/images.rb:10
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:25:in `instance_exec'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:25:in `run'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:50:in `run_initializers'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:49:in `each'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:49:in `run_initializers'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/application.rb:134:in `initialize!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/application.rb:77:in `send'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/application.rb:77:in `method_missing'
from /home/carcher/Code/tgc/config/environment.rb:5
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /home/carcher/Code/tgc/config.ru:3
from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from /home/carcher/Code/tgc/config.ru:1:in `new'
from /home/carcher/Code/tgc/config.ru:1
carcher#carcher-laptop:~/Code/tgc$
I built and installed ImageMagick 6.6.4 from source following the instructions here and BEFORE I did that I removed the ImageMagick tools that were pre-installed in Ubuntu, to avoid any conflicts. But still I seem to have this version 6.5.7 around.
I guess my question is how do I remove/disable ImageMagick 6.5.7-8?
Thanks in advance for the help, I'm all out of ideas.
Cheers, Ciaran.
Lots of help at the Refinery Google group: http://groups.google.com/group/refinery-cms. Or have you tried that already?
I'm up and running! I did a clean Ubuntu install, and just used the pre-installed Imagemagick package. The Refinery CMS tutorial for Lunix omits a few things a novice like me needs to do, so I documented all my steps here.
The main problem was that early in the process when I ran into an issue with RMagick, I presumed I needed a later version of Imagemagick so I downloaded and installed it from source. There is no need to do that - none at all. The version 6.5.7-8 will do just fine and play well with RMagick and with RefineryCMS.
Hope this helps others.
If you need to use the latest version then I found this post that might help. I haven't tried it though:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557778
I posted this info on the RefineryCMS Google message board too.
Cheers,
Ciaran

Resources