Friday, May 4, 2012

Rails 3.1 and Ruby 1.9.3p125: ruby-debug19 crashes with “Symbol not found: _ruby_threadptr_data_type”


download linecache19 and ruby-debug-base19 from RubyForge:

% curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
% curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem


compile the two gems

% gem install linecache19-0.5.13.gem
Building native extensions.  This could take a while...
Successfully installed linecache19-0.5.13
1 gem installed...
% gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$SANDBOX/packages/ruby-1.9.3-p0Building native extensions.  This could take a while...
Successfully installed ruby-debug-base19-0.11.26
1 gem installed...


update your Gemfile

# file: Gemfile
...
group :development do
  gem 'linecache19', '0.5.13'
  gem 'ruby-debug-base19', '0.11.26'
  gem 'ruby-debug19', :require => 'ruby-debug'
end

bundle install and test the debugger

% bundle installFetching source index for http://rubygems.org/
...
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
% irb
irb(main):001:0> require 'ruby-debug'
=> true
irb(main):002:0> debugger
$SANDBOX/usr/lib/ruby/1.9.1/irb/context.rb:166
@last_value = value(rdb:1) p 'hooray'
"hooray"

Ruby-debug fork:
https://github.com/cldwalker/debugger

Discussions:
http://stackoverflow.com/questions/9122232/how-do-i-install-ruby-debug-in-ruby-1-9-3-rails-3-2-1
http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
http://dirk.net/2010/04/17/ruby-debug-with-ruby-19x-and-rails-3-on-rvm
http://stackoverflow.com/questions/7054948/ruby-debug19-on-ruby-1-9-3-preview1

Wednesday, May 2, 2012

Google AppEngine start


- Works with 2.5 or 2.7 python versions.
- Sometimes python path is not saved, just execute command to set a python path:

defaults write com.google.GoogleAppEngineLauncher Python "YOUR_PATH"


- Application name should be conformed with regex   '^(?:[a-z\d\-]{1,100}\~)?(?:(?!\-)[a-z\d\-\.]{1,100}:)?(?!-)[a-z\d\-]{1,100}$'


This is an example error for a project with capital letters in the name:


*** Running dev_appserver with the following flags --admin_console_server= --port=8088

Python command: /usr/bin/python2.5

WARNING  2012-04-30 11:39:22,839 urlfetch_stub.py:111] No ssl package found. urlfetch
will not be able to validate SSL certificates.
WARNING  2012-04-30 11:39:23,686 rdbms_mysqldb.py:74] The rdbms API is not available
because the MySQLdb library could not be loaded.
ERROR    2012-04-30 11:39:24,296 dev_appserver_main.py:580] Fatal error when loading
application configuration:

Unable to assign value 'Test' to attribute 'application':
Value 'Test' for application does not match expression '^(?:[a-z\d\-]{1,100}\~)?(?:(?!\-)[a-z\d\-\.]{1,100}:)?(?!-)[a-z\d\-]{1,100}$'
  in "/Users/MYNAME/Test/app.yaml", line 1, column 14

Sample app.yaml

application: simply-should-work
version: 1
runtime: python27
api_version: 1
threadsafe: yes


handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico


- url: .*
  script: main.app


libraries:
- name: webapp2
  version: "latest"

Current State of Python Packaging

Note: this is a draft description, to be updated...

Packages: Distribute, Easy_install, PIP...

Installation process on Mac OS 10.5.8 with Python 2.5 - Python 3.2

Default version of pip is installed into Python 2.5 path.
This is an installation process of pip 3 version.


PIP can be installed with:
- standalone packet from command line 
- easy_install which is installed with Distribute: Distribute ->  Easy_install  ->  PIP

Common pip installation process:

  1. Download the last pip version from here: http://pypi.python.org/pypi/pip#downloads
  2. Uncompress it
  3. go to the uncompressed pip directory and execute: python3 setup.py install
  4. Add your python to the $PATH (if necessary)

Install pip with Easy_installer

(from windows forum)

  1. Download the latest easy_installer for Windows: (download the .exe at the bottom of http://pypi.python.org/pypi/setuptools ). Install it.
  2. Install PIP from easy_installer ( http://guide.python-distribute.org/installation.html#distribute )

Pip 3 version installation with Distribute (Distribute is a fork of the Setuptools project)
  1. Install Distribute http://pypi.python.org/pypi/distribute
  2. easy_install pip
  3. PIP usage: http://www.pip-installer.org/en/latest/index.html


Distribute documentation: 

More:

Review of packages:




Powered by Blogger.