I got this Exception today:
uninitialized constant ::XPath
The solution is not to use XPath alone. Use instead “REXML::XPath”.
I got this Exception today:
uninitialized constant ::XPath
The solution is not to use XPath alone. Use instead “REXML::XPath”.
Today I got this Exception:
net.sf.jasperreports.engine.JRRuntimeException: Unknown hyperlink target 0
The problem was that I generated the “*.jasper” file with a diffrent version than I used in my app. Since I generated the “*.jasper” file with iReport 4.0.1 and I am using jasperReports 4.0.1 in the tomcat, this error dosn’t occur.
The default HTTP libary in Ruby is pretty ugly. I don’t like it. I found HTTParty on rubygems and this is really easy to use. It is much better than the default HTTP API from ruby. Just add this to your Gemfile:
gem 'httparty', '0.7.4'
With one line you can fetch a site via GET.
html_body = HTTParty.get('http://www.yoursite.com').response.body
That’s it.
This command generates a Comment Model.
rails generate model Comment commenter:string body:text post:references
Since 5 a.m. ET Thursday morning April 21 the EC2 Cloud Service from Amazon in Virginia is down. Amazon is one of the biggest Cloud Service Providers world wide. Even Barak Obama propagated Cloud Computer Services as new green, safe and reliable IT.
Amazon invested a lot of money to make the world believe that their Cloud Service EC2 is high scaleable and high available. Many companies decided to go with Amazon EC2 because they thought the Amazon Cloud would be more reliable than their own IT department. They thought the Cloud would never be down. They thought the Cloud would always scale and always be up. Unfortunately this is not true.
The Amazon EC2 Cloud Service is since over 12 hours down. Many sites are affected. Reddit, HootSuite, Foursquare, Quora, Heroku and Radioactive-Map.com. This is the Fukuschima of Cloud Computing! Nobody thought that this could happen. But it happened.
SCVNGR tweeted: “The sky is falling! Amazon’s cloud seems to be down (raining?) so we’re experiencing some issues too. Be back soon!”
Also the Ruby on Rails App Engine Heroku is down because they are running on Amazon. Heroku is well-known as rock-solid platform for RoR Apps. Many facebook Apps are hosted on Heroku and now they are all down. Here is a Recovery Status Page from Heroku: http://yfrog.com/z/gzuf7xp.
Here you can watch the status of the Amazon Clouds: http://status.aws.amazon.com/
And here is a list of sites who are affected: http://www.ec2disabled.com/
This is a black day for Cloud Providers. Many Managers have to re-think their decisions.
Note for me:
rake [task] RAILS_ENV=production console production rails start -e production
I was the whole weekend on the jQuery conference in Mountain View by Microsoft. It was a nerdy weekend
I was suprised that Microsoft is hosting a conference like jQuery. But they do! Thank you! The Microsoft conference center is pretty cool. In the guarden there is beach volleyball place and a basketball place. The conference rooms are big and you have on every table power outlets for your Notebook.
It was funy to see so many MacBooks in a Microsoft building.
It was a good weekend. I meet some pretty smart guys and learned new stuff. It is always good to learn new stuff.
Note for me! With this command it is possible to generate a migration:
rails generate migration add_email_uniqueness_index
This will generate a file like this:
db/migrate/<Timestamp>add_email_uniqueness_index.rb
With this command all migration scripts will be executed.
rake db:migrate
psql is a command line client for the PostgreSQL Database Engine. If you install postgreSQL on Debian psql is installed by default. After you switched to the postgteSQL user:
su postgres
you can access the client with this simpel command:
psql
and you can exit with this command:
\q
You can set a password with this command inside of the psql client:
ALTER ROLE postgres WITH ENCRYPTED PASSWORD 'postgres';
you can call the help with this command:
\?
It’s a mess! I think more “NOT SEXY” is not possible! MySQL is maybe not as good as PostgreSQL, but from the usability it is 10 times better. In MySQL the command for exit is “exit” not “\q” and for showing the databases the command is “show databases” and for showing tables “show tables”. Much more intuitive than PostgreSQL!
Installing PostgreSQL 8.3 on Debian Linux is pretty easy. With this command it is done.
apt-get install postgresql-8.3
Now the DB system is installed under:
/etc/postgresql/8.3/
You can see the status of the RDBMS with this command:
/etc/init.d/postgresql-8.3 status
You can start it
/etc/init.d/postgresql-8.3 start
and you can stop it
/etc/init.d/postgresql-8.3 stop
After the successful installation there is also a “postgres” user on your system. You can set the password of this user with this command:
passwd postgres
Now you can login as postgres user with:
su postgres
And with this command you can create a database:
createdb testdatabase
Your DB ist up and running.